#NEWLINE# @ mock . patch . object ( linux_net , '_execute' ) #NEWLINE# @ mock . patch . object ( linux_net , 'device_exists' , return_value = True ) #NEWLINE# @ mock . patch . object ( linux_net , '_set_device_mtu' ) #NEWLINE# def test_ensure_vlan_device_exists( self , mock_set_device_mtu , mock_device_exists , mock_execute ) : #NEWLINE# #INDENT# interface = linux_net . LinuxBridgeInterfaceDriver . ensure_vlan ( 1 , 'eth0' ) #NEWLINE# self . assertEqual ( 'vlan1' , interface ) #NEWLINE# mock_device_exists . assert_called_once_with ( 'vlan1' ) #NEWLINE# self . assertFalse ( self . called ) #NEWLINE# mock_set_device_mtu . assert_called_once_with ( 'vlan1' , None )