Ejemplo n.º 1
0
 def test_int_ip(self):
     rd = create_reverse_domain('129', ip_type='4')
     ip = Ip(ip_str="129.193.1.1", ip_type='4')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
     rd = create_reverse_domain('e', ip_type='6')
     ip_str = 'efff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = Ip(ip_str=ip_str, ip_type='6')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
Ejemplo n.º 2
0
 def test_int_ip(self):
     rd = create_reverse_domain('129', ip_type='4')
     ip = Ip(ip_str="129.193.1.1", ip_type='4')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
     rd = create_reverse_domain('e', ip_type='6')
     ip_str = 'efff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = Ip(ip_str=ip_str, ip_type='6')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
Ejemplo n.º 3
0
 def test_int_ip(self):
     rd = self.create_domain(name='129', ip_type='4')
     rd.save()
     ip = Ip(ip_str="129.193.1.1", ip_type='4')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
     rd = boot_strap_ipv6_reverse_domain('e')
     ip_str = 'efff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = Ip(ip_str=ip_str, ip_type='6')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
Ejemplo n.º 4
0
 def test_int_ip(self):
     rd = self.create_domain(name='129', ip_type='4')
     rd.save()
     ip = Ip(ip_str="129.193.1.1", ip_type='4')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
     rd = boot_strap_ipv6_reverse_domain('e')
     ip_str = 'efff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = Ip(ip_str=ip_str, ip_type='6')
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
Ejemplo n.º 5
0
 def test_int_ip(self):
     rd = ReverseDomain(name="129", ip_type="4")
     rd.save()
     ip = Ip(ip_str="129.193.1.1", ip_type="4")
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
     rd = boot_strap_ipv6_reverse_domain("e")
     ip_str = "efff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
     ip = Ip(ip_str=ip_str, ip_type="6")
     ip.clean_ip()
     ip.__int__()
     ip.__repr__()
Ejemplo n.º 6
0
 def test_large_ipv6(self):
     rd = create_reverse_domain('f', ip_type='6')
     ip_str = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = ipaddr.IPv6Address(ip_str)
     ip_upper, ip_lower = ipv6_to_longs(ip_str)
     self.assertEqual(ip.__int__(), (2 ** 64) * ip_upper + ip_lower)
     new_ip = Ip(ip_str=ip_str, ip_upper=ip_upper,
                 ip_lower=ip_lower, ip_type='6')
     new_ip.clean_ip()
     self.assertEqual(ip_str, new_ip.ip_str)
     self.assertEqual(ip.__int__(), new_ip.__int__())
Ejemplo n.º 7
0
 def test_large_ipv6(self):
     rd = create_reverse_domain('f', ip_type='6')
     ip_str = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = ipaddr.IPv6Address(ip_str)
     ip_upper, ip_lower = ipv6_to_longs(ip_str)
     self.assertEqual(ip.__int__(), (2**64) * ip_upper + ip_lower)
     new_ip = Ip(ip_str=ip_str,
                 ip_upper=ip_upper,
                 ip_lower=ip_lower,
                 ip_type='6')
     new_ip.clean_ip()
     self.assertEqual(ip_str, new_ip.ip_str)
     self.assertEqual(ip.__int__(), new_ip.__int__())
Ejemplo n.º 8
0
 def test_large_ipv6(self):
     try:
         rd = boot_strap_ipv6_reverse_domain('f')
         rd.save()
     except ValidationError:
         pass
     ip_str = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = ipaddr.IPv6Address(ip_str)
     ip_upper, ip_lower = ipv6_to_longs(ip_str)
     self.assertEqual(ip.__int__(), (2 ** 64) * ip_upper + ip_lower)
     new_ip = Ip(ip_str=ip_str, ip_upper=ip_upper,
                 ip_lower=ip_lower, ip_type='6')
     new_ip.clean_ip()
     self.assertEqual(ip_str, new_ip.ip_str)
     self.assertEqual(ip.__int__(), new_ip.__int__())
Ejemplo n.º 9
0
 def test_large_ipv6(self):
     try:
         rd = boot_strap_ipv6_reverse_domain('f')
         rd.save()
     except ValidationError:
         pass
     ip_str = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
     ip = ipaddr.IPv6Address(ip_str)
     ip_upper, ip_lower = ipv6_to_longs(ip_str)
     self.assertEqual(ip.__int__(), (2**64) * ip_upper + ip_lower)
     new_ip = Ip(ip_str=ip_str,
                 ip_upper=ip_upper,
                 ip_lower=ip_lower,
                 ip_type='6')
     new_ip.clean_ip()
     self.assertEqual(ip_str, new_ip.ip_str)
     self.assertEqual(ip.__int__(), new_ip.__int__())