|
Server : Apache System : Linux ecngx264.inmotionhosting.com 4.18.0-553.77.1.lve.el8.x86_64 #1 SMP Wed Oct 8 14:21:00 UTC 2025 x86_64 User : lonias5 ( 3576) PHP Version : 7.3.33 Disable Function : NONE Directory : /usr/lib/imh-fail2ban/lib64/python3.13/site-packages/netaddr/tests/eui/ |
Upload File : |
import contextlib
from io import StringIO
from netaddr.compat import _open_binary
from netaddr.eui.ieee import OUIIndexParser, IABIndexParser, FileIndexer
def test_oui_parser():
outfile = StringIO()
with contextlib.closing(_open_binary(__package__, 'sample_oui.txt')) as infile:
iab_parser = OUIIndexParser(infile)
iab_parser.attach(FileIndexer(outfile))
iab_parser.parse()
assert outfile.getvalue() == '51966,1,138\n'
def test_iab_parser():
outfile = StringIO()
with contextlib.closing(_open_binary(__package__, 'sample_iab.txt')) as infile:
iab_parser = IABIndexParser(infile)
iab_parser.attach(FileIndexer(outfile))
iab_parser.parse()
assert outfile.getvalue() == '84683452,1,181\n'