def test_valid_ints(self): self.assertEqual('0.0.0.0', ipv4.int_to_dotquad(0)) self.assertEqual('255.255.255.255', ipv4.int_to_dotquad(0xFFFFFFFF)) self.assertEqual('128.30.92.92', ipv4.int_to_dotquad(2149473372))
def test_backandforth(self): for i in [0, 0xFFFFFFFF, 2149473372]: self.assertEqual(i, ipv4.dotquad_to_int(ipv4.int_to_dotquad(i)))
def test_backandforth(self): for s in ['0.0.0.0', '255.255.255.255', '128.30.92.92']: self.assertEqual(s, ipv4.int_to_dotquad(ipv4.dotquad_to_int(s)))