@@ -242,7 +242,7 @@ def test_quota_list_compute_default(self):
242242 self .assertEqual (self .compute_reference_data , ret_quotas [0 ])
243243 self .assertEqual (1 , len (ret_quotas ))
244244
245- def test_quota_list_compute_no_project (self ):
245+ def test_quota_list_compute_no_project_not_found (self ):
246246 # Make one of the projects disappear
247247 self .compute .quotas .get = mock .Mock (
248248 side_effect = [
@@ -266,6 +266,53 @@ def test_quota_list_compute_no_project(self):
266266 self .assertEqual (self .compute_reference_data , ret_quotas [0 ])
267267 self .assertEqual (1 , len (ret_quotas ))
268268
269+ def test_quota_list_compute_no_project_4xx (self ):
270+ # Make one of the projects disappear
271+ self .compute .quotas .get = mock .Mock (
272+ side_effect = [
273+ self .compute_quotas [0 ],
274+ exceptions .BadRequest ("Bad request" ),
275+ ],
276+ )
277+
278+ arglist = [
279+ '--compute' ,
280+ ]
281+ verifylist = [
282+ ('compute' , True ),
283+ ]
284+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
285+
286+ columns , data = self .cmd .take_action (parsed_args )
287+ ret_quotas = list (data )
288+
289+ self .assertEqual (self .compute_column_header , columns )
290+ self .assertEqual (self .compute_reference_data , ret_quotas [0 ])
291+ self .assertEqual (1 , len (ret_quotas ))
292+
293+ def test_quota_list_compute_no_project_5xx (self ):
294+ # Make one of the projects disappear
295+ self .compute .quotas .get = mock .Mock (
296+ side_effect = [
297+ self .compute_quotas [0 ],
298+ exceptions .HTTPNotImplemented ("Not implemented??" ),
299+ ],
300+ )
301+
302+ arglist = [
303+ '--compute' ,
304+ ]
305+ verifylist = [
306+ ('compute' , True ),
307+ ]
308+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
309+
310+ self .assertRaises (
311+ exceptions .HTTPNotImplemented ,
312+ self .cmd .take_action ,
313+ parsed_args ,
314+ )
315+
269316 def test_quota_list_network (self ):
270317 # Two projects with non-default quotas
271318 self .network .get_quota = mock .Mock (
0 commit comments