<s> from neutron . agent . windows import ip_lib <EOL> from neutron . tests import base <EOL> WRONG_IP = '<STR_LIT>' <EOL> TEST_IP = '<STR_LIT:127.0.0.1>' <EOL> class IpLibTestCase ( base . BaseTestCase ) : <EOL> def test_ipwrapper_get_device_by_ip_None ( self ) : <EOL> self . assertIsNone ( ip_lib . IPWrapper ( ) . get_device_by_ip ( WRONG_IP ) ) <EOL> def test_ipwrapper_get_device_by_ip ( self ) : <EOL> ip_dev = ip_lib . IPWrapper ( ) . get_device_by_ip ( TEST_IP ) <EOL> self . assertEqual ( '<STR_LIT>' , ip_dev . device_name ) <EOL> def test_device_has_ip ( self ) : <EOL> not_a_device = ip_lib . IPDevice ( '<STR_LIT>' ) <EOL> self . assertFalse ( not_a_device . device_has_ip ( TEST_IP ) ) </s>
