diff --git a/tests/helpers/projector.py b/tests/helpers/projector.py index 3191863c5..58319739d 100644 --- a/tests/helpers/projector.py +++ b/tests/helpers/projector.py @@ -30,7 +30,33 @@ from openlp.core.projectors.db import Projector from tests.resources.projector.data import TEST1_DATA +class FakeProjector(object): + """ + Helper test class + """ + def __init__(self, port=4352, name="Faker"): + self.link = self + self.entry = self + self.name = name + self.pin = None + self.port = port + + +class FakePJLinkUDP(object): + """ + Helper test class + """ + def __init__(self, *args, **kwargs): + pass + + def check_settings(self, *args, **kwargs): + pass + + class FakePJLink(object): + """ + Helper class with signals and methods mocked + """ def __init__(self, projector=None, *args, **kwargs): # Signal mocks self.projectorStatus = MagicMock() diff --git a/tests/openlp_core/projectors/commands/test_pjlink.py b/tests/openlp_core/projectors/commands/test_pjlink.py index c44806755..e3496bc43 100644 --- a/tests/openlp_core/projectors/commands/test_pjlink.py +++ b/tests/openlp_core/projectors/commands/test_pjlink.py @@ -30,22 +30,12 @@ from openlp.core.projectors.pjlinkcommands import process_pjlink from openlp.core.projectors.constants import E_AUTHENTICATION, E_NO_AUTHENTICATION, \ S_AUTHENTICATE, S_CONNECT +from tests.helpers.projector import FakeProjector from tests.resources.projector.data import TEST_PIN, TEST_SALT test_module = openlp.core.projectors.pjlinkcommands.__name__ -class FakeProjector(object): - """ - Helper test class - """ - def __init__(self, port=4352, name="Faker"): - self.entry = self - self.name = name - self.pin = None - self.port = port - - @pytest.fixture def fake_pjlink(): """ diff --git a/tests/openlp_core/projectors/manager/test_udp.py b/tests/openlp_core/projectors/manager/test_udp.py index 37a20d5ab..6020b250f 100644 --- a/tests/openlp_core/projectors/manager/test_udp.py +++ b/tests/openlp_core/projectors/manager/test_udp.py @@ -26,7 +26,7 @@ import logging from unittest.mock import MagicMock, patch -from tests.resources.projector.data import FakePJLinkUDP, FakeProjector +from tests.helpers.projector import FakePJLinkUDP, FakeProjector def test_udp_listen_add_duplicate(projector_manager, caplog): diff --git a/tests/resources/projector/data.py b/tests/resources/projector/data.py index 7910bcb05..e11c48c72 100644 --- a/tests/resources/projector/data.py +++ b/tests/resources/projector/data.py @@ -286,24 +286,3 @@ TEST_VIDEO_CODES = { '6Y': 'Internal Y', '6Z': 'Internal Z' } - - -class FakeProjector(object): - """ - Helper test class - """ - def __init__(self, port=4352, name="Faker"): - self.link = self - self.port = port - self.name = name - - -class FakePJLinkUDP(object): - """ - Helper test class - """ - def __init__(self, *args, **kwargs): - pass - - def check_settings(self, *args, **kwargs): - pass