#NEWLINE# def _test_ensure_port_admin_state( self , admin_state ) : #NEWLINE# #INDENT# port_id = 'fake_id' #NEWLINE# with mock . patch . object ( ip_lib , 'IPDevice' ) as dev_mock : #NEWLINE# #INDENT# self . lbm . ensure_port_admin_state ( port_id , admin_state ) #NEWLINE# #UNINDENT# tap_name = self . lbm . get_tap_device_name ( port_id ) #NEWLINE# self . assertEqual ( admin_state , dev_mock ( tap_name ) . link . set_up . called ) #NEWLINE# self . assertNotEqual ( admin_state , dev_mock ( tap_name ) . link . set_down . called )