@@ -229,7 +229,6 @@ def test_snapshot_list_all_projects(self):
229229
230230
231231class TestSnapshotSet (TestSnapshot ):
232-
233232 def setUp (self ):
234233 super (TestSnapshotSet , self ).setUp ()
235234
@@ -270,6 +269,23 @@ def test_snapshot_set(self):
270269 )
271270 self .assertIsNone (result )
272271
272+ def test_snapshot_set_state_to_error (self ):
273+ arglist = [
274+ "--state" , "error" ,
275+ volume_fakes .snapshot_id
276+ ]
277+ verifylist = [
278+ ("state" , "error" ),
279+ ("snapshot" , volume_fakes .snapshot_id )
280+ ]
281+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
282+
283+ result = self .cmd .take_action (parsed_args )
284+
285+ self .snapshots_mock .reset_state .assert_called_with (
286+ volume_fakes .snapshot_id , "error" )
287+ self .assertIsNone (result )
288+
273289
274290class TestSnapshotShow (TestSnapshot ):
275291
@@ -300,7 +316,6 @@ def test_snapshot_show(self):
300316
301317
302318class TestSnapshotUnset (TestSnapshot ):
303-
304319 def setUp (self ):
305320 super (TestSnapshotUnset , self ).setUp ()
306321
@@ -322,6 +337,7 @@ def test_snapshot_unset(self):
322337 ("snapshot" , volume_fakes .snapshot_id ),
323338 ("property" , ["foo" ])
324339 ]
340+
325341 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
326342
327343 result = self .cmd .take_action (parsed_args )
0 commit comments