Esempio n. 1
0
def test_abbreviated_ipv6():
    assert decode(encode('::0')) == '0:0:0:0:0:0:0:0'
    assert decode(encode('0::')) == '0:0:0:0:0:0:0:0'
    assert decode(encode('0::0')) == '0:0:0:0:0:0:0:0'
    assert decode(encode('0:0::0:0')) == '0:0:0:0:0:0:0:0'
Esempio n. 2
0
def test_ipv4():
    assert decode(encode('0.0.0.0')) == '0.0.0.0'
    assert decode(encode('82.158.98.2')) == '82.158.98.2'
    assert decode(encode('255.255.255.255')) == '255.255.255.255'
Esempio n. 3
0
def test_ipv6():
    assert decode(encode('0:0:0:0:0:0:0:0')) == '0:0:0:0:0:0:0:0'
    assert (decode(encode('2c8f:27aa:61fd:56ec:7ebe:d03a:1f50:475f')) ==
            '2c8f:27aa:61fd:56ec:7ebe:d03a:1f50:475f')
    assert (decode(encode('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')) ==
            'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')
Esempio n. 4
0
 def test_ipv6_decode(self):
     for i in range(len(self.ipv6_pairs)):
         self.assertEqual(decode(self.ipv6_pairs[i][1]),
                          self.ipv6_pairs[i][0])
Esempio n. 5
0
 def test_ipv6_decode(self):
     for i in range(len(self.ipv6_pairs)):
         self.assertEqual(decode(self.ipv6_pairs[i][1]),
                          self.ipv6_pairs[i][0])
Esempio n. 6
0
def test_abbreviated_ipv6():
    assert decode(encode('::0')) == '0:0:0:0:0:0:0:0'
    assert decode(encode('0::')) == '0:0:0:0:0:0:0:0'
    assert decode(encode('0::0')) == '0:0:0:0:0:0:0:0'
    assert decode(encode('0:0::0:0')) == '0:0:0:0:0:0:0:0'
Esempio n. 7
0
def test_ipv6():
    assert decode(encode('0:0:0:0:0:0:0:0')) == '0:0:0:0:0:0:0:0'
    assert (decode(encode('2c8f:27aa:61fd:56ec:7ebe:d03a:1f50:475f')) ==
            '2c8f:27aa:61fd:56ec:7ebe:d03a:1f50:475f')
    assert (decode(encode('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')) ==
            'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')
Esempio n. 8
0
def test_ipv4():
    assert decode(encode('0.0.0.0')) == '0.0.0.0'
    assert decode(encode('82.158.98.2')) == '82.158.98.2'
    assert decode(encode('255.255.255.255')) == '255.255.255.255'