From ae2cebb2a60b2410bbe7a80383d0fd8b025c7fb2 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 1 Nov 2018 16:05:37 +0200 Subject: [PATCH] Minimal test for clientStatus consistency --- src/tests/test_api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/test_api.py b/src/tests/test_api.py index c68bd817..2bb6d0ce 100644 --- a/src/tests/test_api.py +++ b/src/tests/test_api.py @@ -60,6 +60,14 @@ class TestAPI(TestProcessProto): 'API Error 0020: Invalid method: test' ) + def test_clientstatus_consistency(self): + """If networkStatus is notConnected networkConnections should be 0""" + status = json.loads(self.api.clientStatus()) + if status["networkStatus"] == "notConnected": + self.assertEqual(status["networkConnections"], 0) + else: + self.assertGreater(status["networkConnections"], 0) + def test_list_addresses(self): """Checking the return of API command 'listAddresses'""" self.assertEqual(