#NEWLINE# def test_list_policy_rules( self ) : #NEWLINE# #INDENT# policy_name = 'classification' #NEWLINE# policy_id = 'e531f2b3-3d97-42c0-b3b5-b7b6ab532018' #NEWLINE# arglist = [ ] #NEWLINE# verifylist = [ ] #NEWLINE# response = { #NEWLINE# #INDENT# 'results' : [ { #NEWLINE# #INDENT# 'id' : policy_id , #NEWLINE# 'owner_id' : 'system' , #NEWLINE# 'name' : policy_name , #NEWLINE# 'kind' : 'nonrecursive' , #NEWLINE# 'description' : 'my description' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# lister = mock . Mock ( return_value = response ) #NEWLINE# self . app . client_manager . congressclient . list_policy = lister #NEWLINE# cmd = policy . ListPolicy ( arglist . app , self . namespace ) #NEWLINE# parsed_args = self . check_parser ( cmd , arglist , verifylist ) #NEWLINE# result = cmd . take_action ( parsed_args ) #NEWLINE# lister . assert_called_with ( ) #NEWLINE# self . assertEqual ( [ 'id' , 'name' , 'owner_id' , 'kind' , 'description' ] , result [ 0 ] )