diff options
author | 2017-11-20 15:20:49 +0000 | |
---|---|---|
committer | 2018-01-22 17:56:02 +0000 | |
commit | bedcb3c33d14bd4259c37bcbca8a49d757c8cef4 (patch) | |
tree | 44db0d02e0b9f1cb65b1e1e599e2568945d65af1 /yardstick/benchmark | |
parent | d2c7cc4e9768ed003257a95c92cdb278d516761b (diff) |
Clean unit tests in "benchmark.scenarios.lib.test_create_volume.py
* Use mock_object.assert_called_with instead of
self.assertTrue(mock_object.called)
* Remove an unneeded if clause in CreateVolume
* Add individual tests for each method in CreateVolume
Change-Id: I54cc56434d316f059b3822879145e6a299866fcb
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/benchmark')
-rw-r--r-- | yardstick/benchmark/scenarios/lib/create_volume.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/yardstick/benchmark/scenarios/lib/create_volume.py b/yardstick/benchmark/scenarios/lib/create_volume.py index c7086d0ef..df523a5ec 100644 --- a/yardstick/benchmark/scenarios/lib/create_volume.py +++ b/yardstick/benchmark/scenarios/lib/create_volume.py @@ -44,22 +44,21 @@ class CreateVolume(base.Scenario): self.setup_done = True - def run(self, result): + def run(self): """execute the test""" if not self.setup_done: self.setup() - if self.image_name: - self.image_id = op_utils.get_image_id(self.glance_client, - self.image_name) + self.image_id = op_utils.get_image_id(self.glance_client, + self.image_name) volume = op_utils.create_volume(self.cinder_client, self.volume_name, self.volume_size, self.image_id) status = volume.status while(status == 'creating' or status == 'downloading'): - LOG.info("Volume status is: %s" % status) + LOG.info("Volume status is: %s", status) time.sleep(5) volume = op_utils.get_volume_by_name(self.volume_name) status = volume.status |