Ejemplo n.º 1
0
 def test_get_shortened_ipv6(self):
     self.assertEqual(
         "abcd:ef01:2345:6789:abcd:ef01:c0a8:fefe",
         utils.get_shortened_ipv6("abcd:ef01:2345:6789:abcd:ef01:192.168.254.254"),
     )
     self.assertEqual("::1", utils.get_shortened_ipv6("0000:0000:0000:0000:0000:0000:0000:0001"))
     self.assertEqual(
         "caca::caca:0:babe:201:102", utils.get_shortened_ipv6("caca:0000:0000:caca:0000:babe:0201:0102")
     )
     self.assertRaises(netaddr.AddrFormatError, utils.get_shortened_ipv6, "127.0.0.1")
     self.assertRaises(netaddr.AddrFormatError, utils.get_shortened_ipv6, "failure")
Ejemplo n.º 2
0
 def test_get_shortened_ipv6(self):
     self.assertEquals("abcd:ef01:2345:6789:abcd:ef01:c0a8:fefe",
                       utils.get_shortened_ipv6(
                         "abcd:ef01:2345:6789:abcd:ef01:192.168.254.254"))
     self.assertEquals("::1", utils.get_shortened_ipv6(
                                 "0000:0000:0000:0000:0000:0000:0000:0001"))
     self.assertEquals("caca::caca:0:babe:201:102",
                       utils.get_shortened_ipv6(
                                 "caca:0000:0000:caca:0000:babe:0201:0102"))
     self.assertRaises(netaddr.AddrFormatError, utils.get_shortened_ipv6,
                       "127.0.0.1")
     self.assertRaises(netaddr.AddrFormatError, utils.get_shortened_ipv6,
                       "failure")