Using assertTrue and the 'is not' operator to test if an element
is not None is too python2.4. Our unit testing framework supports
assertIsNotNone, included from python 2.7, which was created
for these types of tests.
Change-Id: I25c3f2b144357a3f86625deb8e324d78c20b9ce4
'size': 1}}
self.mox.ReplayAll()
weighed_host = sched._schedule(fake_context, request_spec, {})
- self.assertTrue(weighed_host.obj is not None)
+ self.assertIsNotNone(weighed_host.obj)
def test_max_attempts(self):
self.flags(scheduler_max_attempts=4)
'source_volid': HP3PARBaseDriver.VOLUME_ID}
src_vref = {}
model_update = self.driver.create_cloned_volume(volume, src_vref)
- self.assertTrue(model_update is not None)
+ self.assertIsNotNone(model_update)
def test_create_snapshot(self):
self.flags(lock_path=self.tempdir)