#NEWLINE# def test_detail_routes( site , client ) : #NEWLINE# #INDENT# 'Test detail routes for Interfaces objects.' #NEWLINE# ifc_uri = site . list_uri ( 'interface' ) #NEWLINE# dev_uri = site . list_uri ( 'device' ) #NEWLINE# net_uri = site . list_uri ( 'network' ) #NEWLINE# dev_resp = client . create ( dev_uri , hostname = 'foo-bar1' ) #NEWLINE# dev = get_result ( dev_resp ) #NEWLINE# net_resp = client . create ( net_uri , cidr = '10.1.1.0/24' ) #NEWLINE# net = get_result ( net_resp ) #NEWLINE# set_addresses = [ '10.1.1.1/32' , '10.1.1.2/32' , '10.1.1.3/32' ] #NEWLINE# ifc_resp = client . create ( ifc_uri , device = dev [ 'id' ] , name = 'eth0' , addresses = set_addresses ) #NEWLINE# ifc = get_result ( ifc_resp ) #NEWLINE# ifc_obj_uri = site . detail_uri ( 'interface' , id = ifc [ 'id' ] ) #NEWLINE# addresses_resp = client . retrieve ( net_uri , include_ips = True , include_networks = False ) #NEWLINE# addresses = get_result ( addresses_resp ) #NEWLINE# expected = addresses #NEWLINE# addresses_uri = reverse ( 'interface-addresses' , args = ( site . id , ifc [ 'id' ] ) ) #NEWLINE# assert_success ( client . retrieve ( addresses_uri ) , expected ) #NEWLINE# networks_uri = reverse ( 'interface-networks' , args = ( site . id , ifc [ 'id' ] ) ) #NEWLINE# expected = [ dev_uri ] #NEWLINE# assert_success ( client . retrieve ( networks_uri ) , expected )