From b7fee711b651e23487155741b006d9517d033205 Mon Sep 17 00:00:00 2001 From: "Swapnil Kulkarni (coolsvap)" Date: Thu, 7 Jan 2016 12:27:42 +0530 Subject: [PATCH] Use assertTrue/False instead of assertEqual(T/F) The usage of assertEqual(True/False, ***) should be changed to a meaningful format of assertTrue/False(***). Change-Id: Idda812a34be8aa53654d6791eac47028339d3cb7 Closes-Bug:#1512207 --- oslo_messaging/tests/drivers/zmq/test_impl_zmq.py | 4 ++-- oslo_messaging/tests/drivers/zmq/test_pub_sub.py | 4 ++-- oslo_messaging/tests/rpc/test_server.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/oslo_messaging/tests/drivers/zmq/test_impl_zmq.py b/oslo_messaging/tests/drivers/zmq/test_impl_zmq.py index 566b9c7e8..5f86679b3 100644 --- a/oslo_messaging/tests/drivers/zmq/test_impl_zmq.py +++ b/oslo_messaging/tests/drivers/zmq/test_impl_zmq.py @@ -104,7 +104,7 @@ class TestZmqBasics(zmq_common.ZmqBaseTestCase): self.listener._received.wait() self.assertIsNone(result) - self.assertEqual(True, self.listener._received.isSet()) + self.assertTrue(self.listener._received.isSet()) method = self.listener.message.message[u'method'] self.assertEqual(u'hello-world', method) @@ -121,7 +121,7 @@ class TestZmqBasics(zmq_common.ZmqBaseTestCase): self.listener._received.wait() self.assertIsNone(result) - self.assertEqual(True, self.listener._received.isSet()) + self.assertTrue(self.listener._received.isSet()) method = self.listener.message.message[u'method'] self.assertEqual(u'hello-world', method) diff --git a/oslo_messaging/tests/drivers/zmq/test_pub_sub.py b/oslo_messaging/tests/drivers/zmq/test_pub_sub.py index 01619d209..8e17fb85e 100644 --- a/oslo_messaging/tests/drivers/zmq/test_pub_sub.py +++ b/oslo_messaging/tests/drivers/zmq/test_pub_sub.py @@ -65,13 +65,13 @@ class TestPubSub(zmq_common.ZmqBaseTestCase): def _check_listener(self, listener): listener._received.wait(timeout=5) - self.assertEqual(True, listener._received.isSet()) + self.assertTrue(listener._received.isSet()) method = listener.message.message[u'method'] self.assertEqual(u'hello-world', method) def _check_listener_negative(self, listener): listener._received.wait(timeout=1) - self.assertEqual(False, listener._received.isSet()) + self.assertFalse(listener._received.isSet()) def test_single_listener(self): target = oslo_messaging.Target(topic='testtopic', fanout=True) diff --git a/oslo_messaging/tests/rpc/test_server.py b/oslo_messaging/tests/rpc/test_server.py index 846ea86e2..64ae708f0 100644 --- a/oslo_messaging/tests/rpc/test_server.py +++ b/oslo_messaging/tests/rpc/test_server.py @@ -279,7 +279,7 @@ class TestRPCServer(test_utils.BaseTestCase, ServerSetupMixin): self.assertIsNone(client.call({}, 'ping', arg=None)) self.assertEqual(0, client.call({}, 'ping', arg=0)) - self.assertEqual(False, client.call({}, 'ping', arg=False)) + self.assertFalse(client.call({}, 'ping', arg=False)) self.assertEqual([], client.call({}, 'ping', arg=[])) self.assertEqual({}, client.call({}, 'ping', arg={})) self.assertEqual('dsdsfoo', client.call({}, 'ping', arg='foo')) @@ -299,7 +299,7 @@ class TestRPCServer(test_utils.BaseTestCase, ServerSetupMixin): direct = client.prepare(server='testserver') self.assertIsNone(direct.call({}, 'ping', arg=None)) self.assertEqual(0, client.call({}, 'ping', arg=0)) - self.assertEqual(False, client.call({}, 'ping', arg=False)) + self.assertFalse(client.call({}, 'ping', arg=False)) self.assertEqual([], client.call({}, 'ping', arg=[])) self.assertEqual({}, client.call({}, 'ping', arg={})) self.assertEqual('dsdsfoo', direct.call({}, 'ping', arg='foo'))