#NEWLINE# def test_mgr_get_metadata( self ) : #NEWLINE# #INDENT# lb = self . loadbalancer #NEWLINE# mgr = lb . manager #NEWLINE# fake_meta = { #NEWLINE# #INDENT# 'fakekey' : 'fakeval' , #NEWLINE# #UNINDENT# } #NEWLINE# fake_screwy_meta = [ { #NEWLINE# #INDENT# 'key' : 'fakekey' , #NEWLINE# 'value' : 'fakeval' , #NEWLINE# 'id' : 1 , #NEWLINE# #UNINDENT# } ] #NEWLINE# mgr . api . method_get = Mock ( return_value = ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'metadata' : fake_screwy_meta , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# ret = mgr . get_metadata ( lb ) #NEWLINE# uri = ( '/loadbalancers/%s/metadata' % lb . id ) #NEWLINE# mgr . api . method_get . assert_called_once_with ( uri ) #NEWLINE# self . assertEqual ( ret , fake_meta )