def test_set_netmask_no_valid_ip_address(self): st = network.Set() self.assertRaises(NotValidIPv4Address, st.netmask, 'eth0', '255.255.0')
def test_set_netmask_no_valid_interface_name(self): st = network.Set() self.assertRaises(WrongInterfaceName, st.netmask, 'ethh', '255.255.255.0')
def test_set_netmask(self): st = network.Set() gt = network.Get() set_netmask = st.netmask('eth0', '255.255.255.0') current_netmask = gt.netmask('eth0') self.assertEqual(current_netmask, '255.255.255.0')
def test_not_valid_ipv4_address_set(self): st = network.Set() self.assertRaises(NotValidIPv4Address, st.ip, 'eth0', '10.41.0')
def test_false_interface_name_set_ip(self): st = network.Set() self.assertRaises(WrongInterfaceName, st.ip, 'eth', '10.41.0.164')
def test_set_ip(self): st = network.Set() get = network.Get() set_ip = st.ip('eth0', '10.41.0.164') current_ip = get.ip('eth0')[0]['addr'] self.assertEqual(current_ip, '10.41.0.164')