#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# neutronclient : ( 'show_pool' , 'show_vip' , 'list_members' , 'list_health_monitors' ) , #NEWLINE# api . neutron : ( 'subnet_get' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_pool_get( self ) : #NEWLINE# #INDENT# pool = self . pools . first ( ) #NEWLINE# subnet = self . subnets . first ( ) #NEWLINE# pool_dict = { #NEWLINE# #INDENT# 'pool' : self . api_pools . first ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# vip_dict = { #NEWLINE# #INDENT# 'vip' : self . api_vips . first ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# neutronclient . show_pool ( pool . id ) . AndReturn ( pool_dict ) #NEWLINE# api . neutron . subnet_get ( self . request , subnet . id ) . AndReturn ( subnet ) #NEWLINE# neutronclient . show_vip ( pool . vip_id ) . AndReturn ( vip_dict ) #NEWLINE# neutronclient . list_members ( pool_id = pool . id ) . AndReturn ( { #NEWLINE# #INDENT# 'members' : self . api_members . list ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# neutronclient . list_health_monitors ( id = pool . health_monitors ) . AndReturn ( { #NEWLINE# #INDENT# 'health_monitors' : [ self . api_monitors . first ( ) ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# ret_val = api . lbaas . pool_get ( self . request , pool . id ) #NEWLINE# self . assertIsInstance ( ret_val , api . lbaas . Pool ) #NEWLINE# self . assertIsInstance ( ret_val . vip , api . lbaas . Vip ) #NEWLINE# self . assertEqual ( ret_val . vip . id , vip_dict [ 'vip' ] [ 'id' ] ) #NEWLINE# self . assertIsInstance ( ret_val . subnet , api . neutron . Subnet ) #NEWLINE# self . assertEqual ( ret_val . subnet . id , subnet . id ) #NEWLINE# self . assertEqual ( 2 , len ( ret_val . members ) ) #NEWLINE# self . assertIsInstance ( ret_val . members [ 0 ] , api . lbaas . Member ) #NEWLINE# self . assertEqual ( 1 , len ( ret_val . health_monitors ) ) #NEWLINE# self . assertIsInstance ( subnet . health_monitors [ 0 ] , api . lbaas . PoolMonitor )