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:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user