mirror of
https://git.photon.obnh.io/AXSY/whois.git
synced 2026-03-13 02:01:32 +00:00
Initial commit: mwhois with SCION AS support and decimal AS conversion
Based on mwhois by Antonios A. Chariton Modifications for SCION AS support by Olaf Baumert, Axpo Systems AG
This commit is contained in:
88
netaddr/tests/3.x/ip/socket_fallback.txt
Normal file
88
netaddr/tests/3.x/ip/socket_fallback.txt
Normal file
@@ -0,0 +1,88 @@
|
||||
=Socket Fallback Module Tests=
|
||||
|
||||
Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
|
||||
|
||||
{{{
|
||||
|
||||
>>> from netaddr.fbsocket import *
|
||||
|
||||
}}}
|
||||
|
||||
IPv6 '::' compression algorithm tests.
|
||||
|
||||
{{{
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:0:0:0:0:0'))
|
||||
'::'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:0:0:0:0:A'))
|
||||
'::a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:0:0:0:0:0'))
|
||||
'a::'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:A:0:0:0:0:0'))
|
||||
'a:0:a::'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:0:0:0:0:A'))
|
||||
'a::a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:A:0:0:0:0:0:A'))
|
||||
'0:a::a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:A:0:0:0:0:A'))
|
||||
'a:0:a::a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:A:0:0:0:A'))
|
||||
'::a:0:0:0:a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:0:A:0:0:A'))
|
||||
'::a:0:0:a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:0:0:A:0:A'))
|
||||
'a::a:0:a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:A:0:0:A:0'))
|
||||
'a::a:0:0:a:0'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:A:0:A:0:A:0'))
|
||||
'a:0:a:0:a:0:a:0'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:A:0:A:0:A:0:A'))
|
||||
'0:a:0:a:0:a:0:a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '1080:0:0:0:8:800:200C:417A'))
|
||||
'1080::8:800:200c:417a'
|
||||
|
||||
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210'))
|
||||
'fedc:ba98:7654:3210:fedc:ba98:7654:3210'
|
||||
|
||||
}}}
|
||||
|
||||
IPv4 failure tests
|
||||
|
||||
{{{
|
||||
|
||||
>>> inet_ntoa(1)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: string type expected, not <class 'int'>
|
||||
|
||||
|
||||
>>> inet_ntoa('\x00')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: invalid length of packed IP address string
|
||||
|
||||
}}}
|
||||
|
||||
IPv6 failure tests.
|
||||
|
||||
{{{
|
||||
|
||||
>>> inet_pton(AF_INET6, '::0x07f')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: illegal IP address string '::0x07f'
|
||||
|
||||
}}}
|
||||
Reference in New Issue
Block a user