@@ -306,8 +306,8 @@ def setUp(self):
306306 super (TestImageList , self ).setUp ()
307307
308308 self .api_mock = mock .Mock ()
309- self .api_mock .image_list .return_value = [
310- copy .deepcopy (image_fakes .IMAGE ),
309+ self .api_mock .image_list .side_effect = [
310+ [ copy .deepcopy (image_fakes .IMAGE )], [] ,
311311 ]
312312 self .app .client_manager .image .api = self .api_mock
313313
@@ -327,6 +327,7 @@ def test_image_list_no_options(self):
327327 columns , data = self .cmd .take_action (parsed_args )
328328 self .api_mock .image_list .assert_called_with (
329329 detailed = False ,
330+ marker = image_fakes .image_id ,
330331 )
331332
332333 collist = ('ID' , 'Name' )
@@ -354,6 +355,7 @@ def test_image_list_public_option(self):
354355 self .api_mock .image_list .assert_called_with (
355356 detailed = False ,
356357 public = True ,
358+ marker = image_fakes .image_id ,
357359 )
358360
359361 collist = ('ID' , 'Name' )
@@ -381,6 +383,7 @@ def test_image_list_private_option(self):
381383 self .api_mock .image_list .assert_called_with (
382384 detailed = False ,
383385 private = True ,
386+ marker = image_fakes .image_id ,
384387 )
385388
386389 collist = ('ID' , 'Name' )
@@ -405,6 +408,7 @@ def test_image_list_long_option(self):
405408 columns , data = self .cmd .take_action (parsed_args )
406409 self .api_mock .image_list .assert_called_with (
407410 detailed = True ,
411+ marker = image_fakes .image_id ,
408412 )
409413
410414 collist = (
@@ -437,8 +441,8 @@ def test_image_list_long_option(self):
437441
438442 @mock .patch ('openstackclient.api.utils.simple_filter' )
439443 def test_image_list_property_option (self , sf_mock ):
440- sf_mock .return_value = [
441- copy .deepcopy (image_fakes .IMAGE ),
444+ sf_mock .side_effect = [
445+ [ copy .deepcopy (image_fakes .IMAGE )], [] ,
442446 ]
443447
444448 arglist = [
@@ -453,6 +457,7 @@ def test_image_list_property_option(self, sf_mock):
453457 columns , data = self .cmd .take_action (parsed_args )
454458 self .api_mock .image_list .assert_called_with (
455459 detailed = True ,
460+ marker = image_fakes .image_id ,
456461 )
457462 sf_mock .assert_called_with (
458463 [image_fakes .IMAGE ],
@@ -472,8 +477,8 @@ def test_image_list_property_option(self, sf_mock):
472477
473478 @mock .patch ('openstackclient.common.utils.sort_items' )
474479 def test_image_list_sort_option (self , si_mock ):
475- si_mock .return_value = [
476- copy .deepcopy (image_fakes .IMAGE )
480+ si_mock .side_effect = [
481+ [ copy .deepcopy (image_fakes .IMAGE )], [],
477482 ]
478483
479484 arglist = ['--sort' , 'name:asc' ]
@@ -483,7 +488,8 @@ def test_image_list_sort_option(self, si_mock):
483488 # DisplayCommandBase.take_action() returns two tuples
484489 columns , data = self .cmd .take_action (parsed_args )
485490 self .api_mock .image_list .assert_called_with (
486- detailed = False
491+ detailed = False ,
492+ marker = image_fakes .image_id ,
487493 )
488494 si_mock .assert_called_with (
489495 [image_fakes .IMAGE ],
0 commit comments