#NEWLINE# def test_usages_query_tenant_id( self ) : #NEWLINE# #INDENT# test_tenant_id = 'a-unique-test-id' #NEWLINE# with self . network ( tenant_id = test_tenant_id ) as net : #NEWLINE# #INDENT# with self . subnet ( network = net ) : #NEWLINE# #INDENT# params = ( 'tenant_id=%s' % test_tenant_id ) #NEWLINE# request = self . new_list_request ( API_RESOURCE , params = params ) #NEWLINE# response = self . deserialize ( self . fmt , request . get_response ( self . ext_api ) ) #NEWLINE# self . assertIn ( IP_AVAILS_KEY , response ) #NEWLINE# self . assertEqual ( 1 , len ( response [ IP_AVAILS_KEY ] ) ) #NEWLINE# self . _validate_from_availabilities ( response [ IP_AVAILS_KEY ] , net , 0 ) #NEWLINE# for net_avail in response [ IP_AVAILS_KEY ] : #NEWLINE# #INDENT# self . assertEqual ( test_tenant_id , net_avail [ 'tenant_id' ] ) #NEWLINE# #UNINDENT# params = 'tenant_id=clearly-wont-match' #NEWLINE# request = self . new_list_request ( API_RESOURCE , params = params ) #NEWLINE# response = self . deserialize ( self . fmt , request . get_response ( self . ext_api ) ) #NEWLINE# self . assertEqual ( 0 , len ( net_avail [ IP_AVAILS_KEY ] ) )