From 5a0f2f1781e3a6f102c3d451c3f9e823b5b63c68 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 14 Jun 2016 21:18:20 +0100 Subject: [PATCH] fix tests --- openlp/core/api/__init__.py | 2 +- openlp/core/api/apicontroller.py | 2 +- openlp/core/api/wsserver.py | 6 +++--- tests/functional/openlp_core_api/test_apicontroller.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/core/api/__init__.py b/openlp/core/api/__init__.py index 909a739d1..2d89121dd 100644 --- a/openlp/core/api/__init__.py +++ b/openlp/core/api/__init__.py @@ -54,4 +54,4 @@ from .wsserver import WsServer from .httpserver import HttpServer from .apicontroller import ApiController -__all__ = ['Poll', 'RemoteController', 'HttpServer', 'application'] +__all__ = ['Poll', 'ApiController', 'HttpServer', 'application'] diff --git a/openlp/core/api/apicontroller.py b/openlp/core/api/apicontroller.py index df846ca67..62c48a3d5 100644 --- a/openlp/core/api/apicontroller.py +++ b/openlp/core/api/apicontroller.py @@ -49,6 +49,6 @@ class ApiController(RegistryMixin, OpenLPMixin, RegistryProperties): Register the poll return service and start the servers. """ self.poll = Poll() - Registry().register('OpenLPPoll', self.poll) + Registry().register('api_poll', self.poll) self.wsserver = WsServer() self.httpserver = HttpServer() diff --git a/openlp/core/api/wsserver.py b/openlp/core/api/wsserver.py index 108e68426..120967499 100644 --- a/openlp/core/api/wsserver.py +++ b/openlp/core/api/wsserver.py @@ -125,17 +125,17 @@ class WsServer(RegistryProperties, OpenLPMixin): log.debug("web socket handler registered with client") previous_poll = None previous_main_poll = None - openlppoll = Registry().get('OpenLPPoll') + api_poll = Registry().get('api_poll') if path == '/poll': while True: - current_poll = openlppoll.poll() + current_poll = api_poll.poll() if current_poll != previous_poll: yield from request.send(current_poll) previous_poll = current_poll yield from asyncio.sleep(0.2) elif path == '/main_poll': while True: - main_poll = openlppoll.main_poll() + main_poll = api_poll.main_poll() if main_poll != previous_main_poll: yield from request.send(main_poll) previous_main_poll = main_poll diff --git a/tests/functional/openlp_core_api/test_apicontroller.py b/tests/functional/openlp_core_api/test_apicontroller.py index 36ac53cfa..f8a251d38 100644 --- a/tests/functional/openlp_core_api/test_apicontroller.py +++ b/tests/functional/openlp_core_api/test_apicontroller.py @@ -35,9 +35,9 @@ class TestApiController(TestCase): """ A test suite to test out the Error in the API code """ - @patch('openlp.core.api.apicontroller.OpenLPPoll') - @patch('openlp.core.api.apicontroller.OpenLPWSServer') - @patch('openlp.core.api.apicontroller.OpenLPHttpServer') + @patch('openlp.core.api.apicontroller.Poll') + @patch('openlp.core.api.apicontroller.WsServer') + @patch('openlp.core.api.apicontroller.HttpServer') def test_bootstrap(self, mock_http, mock_ws, mock_poll): """ Test the Not Found error displays the correct information