def _set_ip_address(self, ip_address, iface): ip_data = address.IPAddressData(ip_address, device=iface) IPAddress.add(ip_data)
def _test_delete_non_existing_ip(self, ip): with dummy_device() as nic: with self.assertRaises(address.IPAddressDeleteError): IPAddressTest.IPAddress.delete( address.IPAddressData(ip, device=nic))
def _test_add_with_non_existing_device(self, ip): with self.assertRaises(address.IPAddressAddError): IPAddressTest.IPAddress.add( address.IPAddressData(ip, device='tim the enchanter'))
def test_ipv6_init_invalid(self): with self.assertRaises(address.IPAddressDataError): address.IPAddressData(IPV6_INVALID_WITH_PREFIXLEN, device=DEVICE_NAME)
def _test_delete_non_existing_ip(self, ip): with dummy_device() as nic: with pytest.raises(address.IPAddressDeleteError): TestIPAddress.IPAddress.delete( address.IPAddressData(ip, device=nic) )
def _test_add_with_non_existing_device(self, ip): with pytest.raises(address.IPAddressAddError): TestIPAddress.IPAddress.add( address.IPAddressData(ip, device='tim the enchanter') )