Utilizes assertIsNone and assertIsNotNone

Using assertEqual/assertNotEqual to test if an element
is or is not None is too python2.4.
Our unit testing framework supports assertIsNone and assertIsNotNone
which were created for these types of tests.

Change-Id: I29f915ae79bf4f8e9298c5de5d6087828fb0ca4f
This commit is contained in:
Zhongyue Luo
2013-10-11 11:24:18 +08:00
parent f6ad0e3a71
commit d8e6b5408e

View File

@@ -205,7 +205,7 @@ class TryCmdTestCase(test.BaseTestCase):
'openstack.common.processutils.execute', fake_execute_raises))
o, e = processutils.trycmd('this is a command'.split(' '),
discard_warnings=True)
self.assertNotEqual(None, o)
self.assertIsNotNone(o)
self.assertNotEqual('', e)
def test_discard_warnings(self):
@@ -213,7 +213,7 @@ class TryCmdTestCase(test.BaseTestCase):
'openstack.common.processutils.execute', fake_execute))
o, e = processutils.trycmd('this is a command'.split(' '),
discard_warnings=True)
self.assertNotEqual(None, o)
self.assertIsNotNone(o)
self.assertEqual('', e)