#NEWLINE# def test_deletion( site , client ) : #NEWLINE# #INDENT# 'Test deletion of Interfaces.' #NEWLINE# ifc_uri = site . list_uri ( 'interface' ) #NEWLINE# dev_uri = site . list_uri ( 'device' ) #NEWLINE# dev1_resp = client . create ( dev_uri , hostname = 'foo-bar1' ) #NEWLINE# dev1 = get_result ( dev1_resp ) #NEWLINE# dev1_eth0_resp = client . create ( ifc_uri , device = dev1 [ 'id' ] , name = 'eth0' ) #NEWLINE# dev1_eth0 = get_result ( dev1_eth0_resp ) #NEWLINE# dev1_eth0_uri = site . detail_uri ( 'interface' , id = dev1_eth0 [ 'id' ] ) #NEWLINE# dev1_eth1_resp = client . create ( ifc_uri , device = dev1 [ 'id' ] , name = 'eth1' , parent_id = dev1_eth0 [ 'id' ] ) #NEWLINE# dev1_eth1 = get_result ( dev1_eth1_resp ) #NEWLINE# dev1_eth1_uri = site . detail_uri ( 'interface' , id = dev1_eth1 [ 'id' ] ) #NEWLINE# assert_error ( client . delete ( dev1_eth0_uri ) , status . HTTP_409_CONFLICT ) #NEWLINE# client . delete ( dev1_eth1_uri ) #NEWLINE# assert_deleted ( client . delete ( dev1_eth0_uri ) )