summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorXi Yang <yang.xi@99cloud.net>2016-01-18 17:09:14 +0800
committerXi Yang <yang.xi@99cloud.net>2016-03-09 00:13:55 +0800
commit189e4774f88243669ee1b9089d6c39021094c83d (patch)
tree3ea67f456bbb16d4087b7e82fb4f297d0bbc3390 /openstackclient/tests
parent752705ae307e0bf53d4282120009bf3d155da137 (diff)
downloadpython-openstackclient-189e4774f88243669ee1b9089d6c39021094c83d.tar.gz
Add support of setting snapshot state
This patch is going to add the functionality of setting snapshot state which OSC currently lacks. Closes-Bug:#1535239 Change-Id: I2afd6567416e75ba0c70b73351cf1eb5394b3373
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/volume/v2/test_snapshot.py20
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 87e2fccf..9151a1d5 100644
--- a/openstackclient/tests/volume/v2/test_snapshot.py
+++ b/openstackclient/tests/volume/v2/test_snapshot.py
@@ -205,7 +205,6 @@ class TestSnapshotList(TestSnapshot):
class TestSnapshotSet(TestSnapshot):
-
def setUp(self):
super(TestSnapshotSet, self).setUp()
@@ -246,6 +245,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):
@@ -276,7 +292,6 @@ class TestSnapshotShow(TestSnapshot):
class TestSnapshotUnset(TestSnapshot):
-
def setUp(self):
super(TestSnapshotUnset, self).setUp()
@@ -298,6 +313,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)