#NEWLINE# def _test_ensure_port_admin_state( self , admin_state ) : #NEWLINE# #INDENT# dev = 'macvtap1' #NEWLINE# mac = 'mac1' #NEWLINE# self . mgr . mac_device_name_mappings = { #NEWLINE# #INDENT# mac : mac , #NEWLINE# #UNINDENT# } #NEWLINE# with mock . patch . object ( ip_lib , 'IPDevice' ) as mock_ip_dev : #NEWLINE# #INDENT# self . mgr . ensure_port_admin_state ( mac , admin_state ) #NEWLINE# self . assertEqual ( admin_state , mock_ip_dev ( dev ) . link . set_up . called ) #NEWLINE# self . assertNotEqual ( admin_state , mock_ip_dev ( dev ) . link . set_down . called )