Skip to content

Commit

Permalink
add command to retrieve list of composite modes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaZderMind committed May 29, 2018
1 parent c982518 commit 803ece9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions voctocore/lib/commands.py
Expand Up @@ -147,6 +147,12 @@ def get_composite_mode(self):
status = self._get_composite_status()
return OkResponse('composite_mode', status)

def get_composite_modes(self):
"""lists the names of all available composite-mode"""
names = [mode.name for mode in CompositeModes]
namestr = ','.join(names)
return OkResponse('composite_modes', namestr)

def get_composite_mode_and_video_status(self):
"""retrieves the composite-mode and the video-status
in a single call"""
Expand Down
13 changes: 13 additions & 0 deletions voctocore/tests/commands/test_get_composite_modes.py
@@ -0,0 +1,13 @@
from lib.response import OkResponse
from tests.commands.commands_test_base import CommandsTestBase


class GetCompositeModesTest(CommandsTestBase):
def test_get_composite_modes(self):
response = self.commands.get_composite_modes()

self.assertIsInstance(response, OkResponse)
self.assertEqual(response.args, (
'composite_modes',
'fullscreen,side_by_side_equal,side_by_side_preview,picture_in_picture'
))

0 comments on commit 803ece9

Please sign in to comment.