예제 #1
0
    def test_ipv6_addr(self):
        '''
        Test IPv6 address validation
        '''
        true_addrs = [
            '::',
            '::1',
            '::1/32',
            '::1/32',
            '::1/128',
            '2a03:4000:c:10aa:1017:f00d:aaaa:a',
        ]

        false_addrs = [
            '1.1.1.1',
            '::1/0',
            '::1/32d',
            '::1/129',
            '2a03:4000:c:10aa:1017:f00d:aaaa:a:4506',
            '2a03::1::2',
        ]

        for addr in true_addrs:
            self.assertTrue(net.ipv6_addr(addr))

        for addr in false_addrs:
            self.assertFalse(net.ipv6_addr(addr))
예제 #2
0
    def test_ipv6_addr(self):
        """
        Test IPv6 address validation
        """
        true_addrs = [
            "::",
            "::1",
            "::1/32",
            "::1/32",
            "::1/128",
            "2a03:4000:c:10aa:1017:f00d:aaaa:a",
        ]

        false_addrs = [
            "1.1.1.1",
            "::1/0",
            "::1/32d",
            "::1/129",
            "2a03:4000:c:10aa:1017:f00d:aaaa:a:4506",
            "2a03::1::2",
        ]

        for addr in true_addrs:
            self.assertTrue(net.ipv6_addr(addr))

        for addr in false_addrs:
            self.assertFalse(net.ipv6_addr(addr))
    def test_ipv6_addr(self):
        """
        Test IPv6 address validation
        """
        self.assertTrue(net.ipv6_addr("::1"))
        self.assertTrue(net.ipv6_addr("::1/32"))
        self.assertTrue(net.ipv6_addr("::1/32"))
        self.assertTrue(net.ipv6_addr("::1/128"))
        self.assertTrue(net.ipv6_addr("2a03:4000:c:10aa:1017:f00d:aaaa:a"))

        self.assertFalse(net.ipv6_addr("1.1.1.1"))
        self.assertFalse(net.ipv6_addr("::1/0"))
        self.assertFalse(net.ipv6_addr("::1/32d"))
        self.assertFalse(net.ipv6_addr("::1/129"))
예제 #4
0
    def test_ipv6_addr(self):
        '''
        Test IPv6 address validation
        '''
        self.assertTrue(net.ipv6_addr('::1'))
        self.assertTrue(net.ipv6_addr('::1/32'))
        self.assertTrue(net.ipv6_addr('::1/32'))
        self.assertTrue(net.ipv6_addr('::1/128'))
        self.assertTrue(net.ipv6_addr('2a03:4000:c:10aa:1017:f00d:aaaa:a'))

        self.assertFalse(net.ipv6_addr('1.1.1.1'))
        self.assertFalse(net.ipv6_addr('::1/0'))
        self.assertFalse(net.ipv6_addr('::1/32d'))
        self.assertFalse(net.ipv6_addr('::1/129'))
예제 #5
0
    def test_ipv6_addr(self):
        '''
        Test IPv6 address validation
        '''
        true_addrs = [
            '::1',
            '::1/32',
            '::1/32',
            '::1/128',
            '2a03:4000:c:10aa:1017:f00d:aaaa:a',
        ]

        false_addrs = [
            '1.1.1.1',
            '::1/0',
            '::1/32d',
            '::1/129',
        ]

        for addr in true_addrs:
            self.assertTrue(net.ipv6_addr(addr))

        for addr in false_addrs:
            self.assertFalse(net.ipv6_addr(addr))