Exemplo n.º 1
0
 def test_v6_arpa_boundary_32bit(self):
     """Test generating 32-bit v6 boundary"""
     rdns = ip_to_rdns(VALID_V6_1, boundary=True, v6_boundary=32)
     self.assertEqual(rdns, VALID_V6_1_32BOUND)
Exemplo n.º 2
0
 def test_v4_arpa_boundary_24bit(self):
     """Test generating 24-bit v4 boundary"""
     rdns = ip_to_rdns(VALID_V4_1, boundary=True, v4_boundary=24)
     self.assertEqual(rdns, VALID_V4_1_24BOUND)
Exemplo n.º 3
0
 def test_v6_arpa_boundary_16bit(self):
     """Test generating 16-bit v6 boundary"""
     rdns = ip_to_rdns(VALID_V6_1, boundary=True, v6_boundary=16)
     self.assertEqual(rdns, VALID_V6_1_16BOUND)
Exemplo n.º 4
0
 def test_v4_to_arpa(self):
     """Test generating rDNS for standard v4"""
     rdns = ip_to_rdns(VALID_V4_2)
     self.assertEqual(rdns, VALID_V4_2_RDNS)
Exemplo n.º 5
0
 def test_v6_to_arpa(self):
     """Test generating rDNS for standard v6"""
     rdns = ip_to_rdns(VALID_V6_1)
     self.assertEqual(rdns, VALID_V6_1_RDNS)
Exemplo n.º 6
0
 def test_v6_inv_boundary(self):
     """Raise if IPv6 boundary isn't dividable by 4"""
     with self.assertRaises(BoundaryException):
         ip_to_rdns(VALID_V6_1, boundary=True, v6_boundary=9)
Exemplo n.º 7
0
 def test_v6_inv_boundary_2(self):
     """Raise if IPv6 boundary is too short"""
     with self.assertRaises(BoundaryException):
         ip_to_rdns(VALID_V6_1, boundary=True, v6_boundary=0)
Exemplo n.º 8
0
 def test_v4_inv_boundary(self):
     """Raise if IPv4 boundary isn't divisable by 8"""
     with self.assertRaises(BoundaryException):
         ip_to_rdns(VALID_V4_2, boundary=True, v4_boundary=7)
Exemplo n.º 9
0
 def test_v6_invalid_2(self):
     """Raise if v6 address has invalid chars"""
     with self.assertRaises(ValueError):
         ip_to_rdns('2001::fh')
Exemplo n.º 10
0
 def test_v6_invalid(self):
     """Raise if IPv6 address has invalid block formatting"""
     with self.assertRaises(ValueError):
         ip_to_rdns('2001::ff::a')
Exemplo n.º 11
0
 def test_v4_invalid_2(self):
     """Raise if IPv4 address has octet out of range"""
     with self.assertRaises(ValueError):
         ip_to_rdns('127.0.0.373')
Exemplo n.º 12
0
 def test_v4_invalid(self):
     """Raise if IPv4 address has < 4 octets"""
     with self.assertRaises(ValueError):
         ip_to_rdns('127.0.0')