Skip to content

Commit

Permalink
Unittest - controller.py - get_preview_ports
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Aug 1, 2013
1 parent 5cd2849 commit 13455e4
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions python-api/gstswitch/test_controller.py
Expand Up @@ -160,15 +160,18 @@ def test_normal_unpack(self):
assert controller.get_audio_port() == 4000


# class TestGetPreviewPorts(object):

# def test_unpack(self):
# controller = Controller(address='unix:abstract=abcdefghijk')
# controller.connection = MockConnection(True)
# with pytest.raises(ConnectionError):
# controller.get_preview_ports()

# def test_normal_unpack(self):
# controller = Controller(address='unix:abstract=abcdef')
# controller.connection = MockConnection(False)
# assert controller.get_preview_ports() == '[(3002, 1, 7), (3003, 1, 8)]'
class TestGetPreviewPorts(object):

def test_unpack(self):
controller = Controller(address='unix:abstract=abcdefghijk')
controller.connection = MockConnection(True)
with pytest.raises(ConnectionError):
controller.get_preview_ports()

def test_normal_unpack(self):
controller = Controller(address='unix:abstract=abcdef')
controller.connection = MockConnection(False)
controller._parse_preview_ports = Mock(return_value=[3001, 3002])
assert controller.get_preview_ports() == [3001, 3002]


0 comments on commit 13455e4

Please sign in to comment.