From 83aa5a5e799d75dc0d11f38008c3b9d0f9170b6a Mon Sep 17 00:00:00 2001 From: Anze Kolar Date: Thu, 20 Jul 2017 15:49:26 +0200 Subject: [PATCH] Update tests to work with python versions < py3.6 --- tests/client/test_AprsClient.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/client/test_AprsClient.py b/tests/client/test_AprsClient.py index 8210adf..fa6e88c 100644 --- a/tests/client/test_AprsClient.py +++ b/tests/client/test_AprsClient.py @@ -57,14 +57,13 @@ class OgnClientTest(unittest.TestCase): # After .disconnect(), client._kill should be True self.assertTrue(client._kill) - mock_callback.assert_called_once() + self.assertEqual(mock_callback.call_count, 1) # After we reconnect, .run() should be able to run again - mock_callback = mock.MagicMock( - side_effect=lambda raw_msg: client.disconnect()) + mock_callback.reset_mock() client.connect() client.run(callback=mock_callback, autoreconnect=True) - mock_callback.assert_called_once() + self.assertEqual(mock_callback.call_count, 1) def test_50_live_messages(self): print("Enter")