@@ -486,6 +486,7 @@ def test_image_list_no_options(self):
486486 ('private' , False ),
487487 ('community' , False ),
488488 ('shared' , False ),
489+ ('all' , False ),
489490 ('long' , False ),
490491 ]
491492 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -510,6 +511,7 @@ def test_image_list_public_option(self):
510511 ('private' , False ),
511512 ('community' , False ),
512513 ('shared' , False ),
514+ ('all' , False ),
513515 ('long' , False ),
514516 ]
515517 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -534,6 +536,7 @@ def test_image_list_private_option(self):
534536 ('private' , True ),
535537 ('community' , False ),
536538 ('shared' , False ),
539+ ('all' , False ),
537540 ('long' , False ),
538541 ]
539542 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -558,6 +561,7 @@ def test_image_list_community_option(self):
558561 ('private' , False ),
559562 ('community' , True ),
560563 ('shared' , False ),
564+ ('all' , False ),
561565 ('long' , False ),
562566 ]
563567 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -582,6 +586,7 @@ def test_image_list_shared_option(self):
582586 ('private' , False ),
583587 ('community' , False ),
584588 ('shared' , True ),
589+ ('all' , False ),
585590 ('long' , False ),
586591 ]
587592 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -597,6 +602,31 @@ def test_image_list_shared_option(self):
597602 self .assertEqual (self .columns , columns )
598603 self .assertCountEqual (self .datalist , tuple (data ))
599604
605+ def test_image_list_all_option (self ):
606+ arglist = [
607+ '--all' ,
608+ ]
609+ verifylist = [
610+ ('public' , False ),
611+ ('private' , False ),
612+ ('community' , False ),
613+ ('shared' , False ),
614+ ('all' , True ),
615+ ('long' , False ),
616+ ]
617+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
618+
619+ # In base command class Lister in cliff, abstract method take_action()
620+ # returns a tuple containing the column names and an iterable
621+ # containing the data to be listed.
622+ columns , data = self .cmd .take_action (parsed_args )
623+ self .client .images .assert_called_with (
624+ visibility = 'all' ,
625+ )
626+
627+ self .assertEqual (self .columns , columns )
628+ self .assertCountEqual (self .datalist , tuple (data ))
629+
600630 def test_image_list_shared_member_status_option (self ):
601631 arglist = [
602632 '--shared' ,
@@ -607,6 +637,7 @@ def test_image_list_shared_member_status_option(self):
607637 ('private' , False ),
608638 ('community' , False ),
609639 ('shared' , True ),
640+ ('all' , False ),
610641 ('long' , False ),
611642 ('member_status' , 'all' )
612643 ]
@@ -634,6 +665,7 @@ def test_image_list_shared_member_status_lower(self):
634665 ('private' , False ),
635666 ('community' , False ),
636667 ('shared' , True ),
668+ ('all' , False ),
637669 ('long' , False ),
638670 ('member_status' , 'all' )
639671 ]
0 commit comments