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:
96
netaddr/tests/3.x/strategy/eui48.txt
Normal file
96
netaddr/tests/3.x/strategy/eui48.txt
Normal file
@@ -0,0 +1,96 @@
|
||||
=IEEE EUI-48 Strategy Module=
|
||||
|
||||
Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
|
||||
|
||||
{{{
|
||||
|
||||
>>> from netaddr.strategy.eui48 import *
|
||||
|
||||
}}}
|
||||
|
||||
==Basic Smoke Tests==
|
||||
|
||||
{{{
|
||||
|
||||
>>> b = '00000000-00001111-00011111-00010010-11100111-00110011'
|
||||
>>> i = 64945841971
|
||||
>>> t = (0x0, 0x0f, 0x1f, 0x12, 0xe7, 0x33)
|
||||
>>> s = '00-0F-1F-12-E7-33'
|
||||
>>> p = b'\x00\x0f\x1f\x12\xe73'
|
||||
|
||||
>>> bits_to_int(b) == 64945841971
|
||||
True
|
||||
|
||||
>>> int_to_bits(i) == b
|
||||
True
|
||||
|
||||
>>> int_to_str(i)
|
||||
'00-0F-1F-12-E7-33'
|
||||
|
||||
>>> int_to_words(i)
|
||||
(0, 15, 31, 18, 231, 51)
|
||||
|
||||
>>> int_to_packed(i)
|
||||
b'\x00\x0f\x1f\x12\xe73'
|
||||
|
||||
>>> str_to_int(s) == 64945841971
|
||||
True
|
||||
|
||||
>>> words_to_int(t) == 64945841971
|
||||
True
|
||||
|
||||
>>> words_to_int(list(t)) == 64945841971
|
||||
True
|
||||
|
||||
>>> packed_to_int(p) == 64945841971
|
||||
True
|
||||
|
||||
}}}
|
||||
|
||||
==Smoke Tests With Alternate Dialects==
|
||||
|
||||
{{{
|
||||
|
||||
>>> b = '00000000:00001111:00011111:00010010:11100111:00110011'
|
||||
>>> i = 64945841971
|
||||
>>> t = (0x0, 0x0f, 0x1f, 0x12, 0xe7, 0x33)
|
||||
>>> s = '0:f:1f:12:e7:33'
|
||||
>>> p = b'\x00\x0f\x1f\x12\xe73'
|
||||
|
||||
>>> bits_to_int(b, mac_unix) == 64945841971
|
||||
True
|
||||
|
||||
>>> int_to_bits(i, mac_unix) == b
|
||||
True
|
||||
|
||||
>>> int_to_str(i, mac_unix)
|
||||
'0:f:1f:12:e7:33'
|
||||
|
||||
>>> int_to_str(i, mac_unix_expanded)
|
||||
'00:0f:1f:12:e7:33'
|
||||
|
||||
>>> int_to_str(i, mac_cisco)
|
||||
'000f.1f12.e733'
|
||||
|
||||
>>> int_to_str(i, mac_unix)
|
||||
'0:f:1f:12:e7:33'
|
||||
|
||||
>>> int_to_words(i, mac_unix)
|
||||
(0, 15, 31, 18, 231, 51)
|
||||
|
||||
>>> int_to_packed(i)
|
||||
b'\x00\x0f\x1f\x12\xe73'
|
||||
|
||||
>>> str_to_int(s) == 64945841971
|
||||
True
|
||||
|
||||
>>> words_to_int(t, mac_unix) == 64945841971
|
||||
True
|
||||
|
||||
>>> words_to_int(list(t), mac_unix) == 64945841971
|
||||
True
|
||||
|
||||
>>> packed_to_int(p) == 64945841971
|
||||
True
|
||||
|
||||
}}}
|
||||
Reference in New Issue
Block a user