@@ -85,13 +85,37 @@ def test_service_list(self):
8585 # In base command class Lister in cliff, abstract method take_action()
8686 # returns a tuple containing the column names and an iterable
8787 # containing the data to be listed.
88- self .cmd .take_action (parsed_args )
88+ columns , data = self .cmd .take_action (parsed_args )
8989
9090 self .service_mock .list .assert_called_with (
9191 compute_fakes .service_host ,
9292 compute_fakes .service_binary ,
9393 )
9494
95+ self .assertNotIn ("Disabled Reason" , columns )
96+ self .assertNotIn (compute_fakes .service_disabled_reason , list (data )[0 ])
97+
98+ def test_service_list_with_long_option (self ):
99+ arglist = [
100+ '--host' , compute_fakes .service_host ,
101+ '--service' , compute_fakes .service_binary ,
102+ '--long'
103+ ]
104+ verifylist = [
105+ ('host' , compute_fakes .service_host ),
106+ ('service' , compute_fakes .service_binary ),
107+ ('long' , True )
108+ ]
109+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
110+
111+ # In base command class Lister in cliff, abstract method take_action()
112+ # returns a tuple containing the column names and an iterable
113+ # containing the data to be listed.
114+ columns , data = self .cmd .take_action (parsed_args )
115+
116+ self .assertIn ("Disabled Reason" , columns )
117+ self .assertIn (compute_fakes .service_disabled_reason , list (data )[0 ])
118+
95119
96120class TestServiceSet (TestService ):
97121
0 commit comments