diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-05-18 16:49:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-05-18 16:49:07 +0000 |
| commit | 7a0845ec1127b89073845f07425b17651b005c38 (patch) | |
| tree | 8e8bf31672c6572c34359004b91280d5149dfdfc /openstackclient/tests/volume | |
| parent | 78c20f6f38f26d18ad769c0660451237a856c60e (diff) | |
| parent | 189e4774f88243669ee1b9089d6c39021094c83d (diff) | |
| download | python-openstackclient-7a0845ec1127b89073845f07425b17651b005c38.tar.gz | |
Merge "Add support of setting snapshot state"
Diffstat (limited to 'openstackclient/tests/volume')
| -rw-r--r-- | openstackclient/tests/volume/v2/test_snapshot.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/openstackclient/tests/volume/v2/test_snapshot.py b/openstackclient/tests/volume/v2/test_snapshot.py index 8c75dfb2..d2fa5e07 100644 --- a/openstackclient/tests/volume/v2/test_snapshot.py +++ b/openstackclient/tests/volume/v2/test_snapshot.py @@ -229,7 +229,6 @@ class TestSnapshotList(TestSnapshot): class TestSnapshotSet(TestSnapshot): - def setUp(self): super(TestSnapshotSet, self).setUp() @@ -270,6 +269,23 @@ class TestSnapshotSet(TestSnapshot): ) self.assertIsNone(result) + def test_snapshot_set_state_to_error(self): + arglist = [ + "--state", "error", + volume_fakes.snapshot_id + ] + verifylist = [ + ("state", "error"), + ("snapshot", volume_fakes.snapshot_id) + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + self.snapshots_mock.reset_state.assert_called_with( + volume_fakes.snapshot_id, "error") + self.assertIsNone(result) + class TestSnapshotShow(TestSnapshot): @@ -300,7 +316,6 @@ class TestSnapshotShow(TestSnapshot): class TestSnapshotUnset(TestSnapshot): - def setUp(self): super(TestSnapshotUnset, self).setUp() @@ -322,6 +337,7 @@ class TestSnapshotUnset(TestSnapshot): ("snapshot", volume_fakes.snapshot_id), ("property", ["foo"]) ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) |
