@@ -179,7 +179,24 @@ def test_snapshot_delete(self):
179179 result = self .cmd .take_action (parsed_args )
180180
181181 self .snapshots_mock .delete .assert_called_with (
182- self .snapshots [0 ].id )
182+ self .snapshots [0 ].id , False )
183+ self .assertIsNone (result )
184+
185+ def test_snapshot_delete_with_force (self ):
186+ arglist = [
187+ '--force' ,
188+ self .snapshots [0 ].id
189+ ]
190+ verifylist = [
191+ ('force' , True ),
192+ ("snapshots" , [self .snapshots [0 ].id ])
193+ ]
194+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
195+
196+ result = self .cmd .take_action (parsed_args )
197+
198+ self .snapshots_mock .delete .assert_called_with (
199+ self .snapshots [0 ].id , True )
183200 self .assertIsNone (result )
184201
185202 def test_delete_multiple_snapshots (self ):
@@ -195,7 +212,7 @@ def test_delete_multiple_snapshots(self):
195212
196213 calls = []
197214 for s in self .snapshots :
198- calls .append (call (s .id ))
215+ calls .append (call (s .id , False ))
199216 self .snapshots_mock .delete .assert_has_calls (calls )
200217 self .assertIsNone (result )
201218
@@ -226,7 +243,7 @@ def test_delete_multiple_snapshots_with_exception(self):
226243
227244 self .assertEqual (2 , find_mock .call_count )
228245 self .snapshots_mock .delete .assert_called_once_with (
229- self .snapshots [0 ].id
246+ self .snapshots [0 ].id , False
230247 )
231248
232249
0 commit comments