@@ -353,3 +353,46 @@ def test_consistency_group_list_with_long(self):
353353 detailed = True , search_opts = {'all_tenants' : False })
354354 self .assertEqual (self .columns_long , columns )
355355 self .assertEqual (self .data_long , list (data ))
356+
357+
358+ class TestConsistencyGroupShow (TestConsistencyGroup ):
359+ columns = (
360+ 'availability_zone' ,
361+ 'created_at' ,
362+ 'description' ,
363+ 'id' ,
364+ 'name' ,
365+ 'status' ,
366+ 'volume_types' ,
367+ )
368+
369+ def setUp (self ):
370+ super (TestConsistencyGroupShow , self ).setUp ()
371+
372+ self .consistency_group = (
373+ volume_fakes .FakeConsistencyGroup .create_one_consistency_group ())
374+ self .data = (
375+ self .consistency_group .availability_zone ,
376+ self .consistency_group .created_at ,
377+ self .consistency_group .description ,
378+ self .consistency_group .id ,
379+ self .consistency_group .name ,
380+ self .consistency_group .status ,
381+ self .consistency_group .volume_types ,
382+ )
383+ self .consistencygroups_mock .get .return_value = self .consistency_group
384+ self .cmd = consistency_group .ShowConsistencyGroup (self .app , None )
385+
386+ def test_consistency_group_show (self ):
387+ arglist = [
388+ self .consistency_group .id
389+ ]
390+ verifylist = [
391+ ("consistency_group" , self .consistency_group .id )
392+ ]
393+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
394+ columns , data = self .cmd .take_action (parsed_args )
395+ self .consistencygroups_mock .get .assert_called_once_with (
396+ self .consistency_group .id )
397+ self .assertEqual (self .columns , columns )
398+ self .assertEqual (self .data , data )
0 commit comments