#NEWLINE# def test_get_id_from_name_multiple_with_project( self ) : #NEWLINE# #INDENT# name = 'web_server' #NEWLINE# project = str ( uuid . uuid4 ( ) ) #NEWLINE# expect_id = str ( uuid . uuid4 ( ) ) #NEWLINE# reses = { #NEWLINE# #INDENT# 'security_groups' : [ { #NEWLINE# #INDENT# 'id' : expect_id , #NEWLINE# 'tenant_id' : project , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# resstr = self . client . serialize ( reses ) #NEWLINE# self . mox . StubOutWithMock ( self . client . httpclient , 'request' ) #NEWLINE# path = getattr ( self . client , 'security_groups_path' ) #NEWLINE# self . client . httpclient . request ( test_cli20 . MyUrlComparator ( test_cli20 . end_url ( path , ( 'fields=id&name=%s&tenant_id=%s' % ( name , project ) ) ) , self . client ) , 'GET' , body = None , headers = mox . ContainsKeyValue ( 'X-Auth-Token' , test_cli20 . TOKEN ) ) . AndReturn ( ( test_cli20 . MyResp ( 200 ) , resstr ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# observed_id = neutronV20 . find_resourceid_by_name_or_id ( self . client , 'security_group' , name , project ) #NEWLINE# self . assertEqual ( expect_id , observed_id )