diff --git a/openlp/core/projectors/pjlink.py b/openlp/core/projectors/pjlink.py index 99fb6956c..0a18aef33 100644 --- a/openlp/core/projectors/pjlink.py +++ b/openlp/core/projectors/pjlink.py @@ -657,7 +657,7 @@ class PJLink(QtNetwork.QTcpSocket, PJLinkCommands): except TypeError: pass try: - self.readyRead.connect(self.get_socket) # Set in process_pjlink + self.readyRead.disconnect(self.get_socket) # Set in process_pjlink except TypeError: pass diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py index 08682ccb7..62ba4ec76 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py @@ -69,7 +69,7 @@ class TestPJLinkCommands(TestCase): # THEN: proper processing should have occured mock_log.debug.has_calls(log_check) mock_disconnect_from_host.assert_not_called() - mock_readyRead.connect.assert_called_once() + self.assertEqual(mock_readyRead.connect.call_count, 1, 'Should have only been called once') mock_change_status.assert_called_once_with(S_CONNECTED) mock_send_command.assert_called_with(cmd='CLSS', priority=True, salt=None) @@ -93,7 +93,7 @@ class TestPJLinkCommands(TestCase): # THEN: proper processing should have occured mock_log.debug.has_calls(log_check) mock_disconnect_from_host.assert_not_called() - mock_readyRead.connect.assert_called_once() + self.assertEqual(mock_readyRead.connect.call_count, 1, 'Should have only been called once') mock_change_status.assert_called_once_with(S_CONNECTED) mock_send_command.assert_called_with(cmd='CLSS', priority=True, salt=TEST_HASH) @@ -115,7 +115,7 @@ class TestPJLinkCommands(TestCase): # THEN: Proper calls should be made mock_log.error.assert_has_calls(log_check) - mock_disconnect_from_host.assert_called_once() + self.assertEqual(mock_disconnect_from_host.call_count, 1, 'Should have only been called once') mock_send_command.assert_not_called() def test_process_pjlink_normal_with_salt_error(self): @@ -136,7 +136,7 @@ class TestPJLinkCommands(TestCase): # THEN: Proper calls should be made mock_log.error.assert_has_calls(log_check) - mock_disconnect_from_host.assert_called_once() + self.assertEqual(mock_disconnect_from_host.call_count, 1, 'Should have only been called once') mock_send_command.assert_not_called() def test_process_pjlink_invalid_authentication_scheme_length_error(self): @@ -155,7 +155,7 @@ class TestPJLinkCommands(TestCase): # THEN: socket should be closed and invalid data logged mock_log.error.assert_has_calls(log_check) - mock_disconnect_from_host.assert_called_once() + self.assertEqual(mock_disconnect_from_host.call_count, 1, 'Should have only been called once') mock_send_command.assert_not_called() def test_process_pjlink_invalid_authentication_data_length_error(self): @@ -174,7 +174,7 @@ class TestPJLinkCommands(TestCase): # THEN: socket should be closed and invalid data logged mock_log.error.assert_has_calls(log_check) - mock_disconnect_from_host.assert_called_once() + self.assertEqual(mock_disconnect_from_host.call_count, 1, 'Should have only been called once') mock_send_command.assert_not_called() def test_process_pjlink_authenticate_pin_not_set_error(self): @@ -194,5 +194,5 @@ class TestPJLinkCommands(TestCase): # THEN: socket should be closed and invalid data logged mock_log.error.assert_has_calls(log_check) - mock_disconnect_from_host.assert_called_once() + self.assertEqual(mock_disconnect_from_host.call_count, 1, 'Should have only been called once') mock_send_command.assert_not_called()