=IEEE Publish/Subscribe Parser Tests=

Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.

Basic OUIIndexParser and FileIndexer object tests.

{{{ 

>>> from netaddr.eui.ieee import OUIIndexParser, IABIndexParser, FileIndexer
>>> from io import StringIO

>>> infile = StringIO()
>>> outfile = StringIO()
>>> infile.write("""
... 00-CA-FE   (hex)        ACME CORPORATION
... 00CAFE     (base 16)        ACME CORPORATION
... 				1 MAIN STREET
... 				SPRINGFIELD
... 				UNITED STATES
... """)
211
>>> infile.seek(0)
0
>>> iab_parser = OUIIndexParser(infile)
>>> iab_parser.attach(FileIndexer(outfile))
>>> iab_parser.parse()
>>> print(outfile.getvalue())
51966,1,210
<BLANKLINE>

}}}

Basic IABIndexParser and FileIndexer object tests.

{{{ 

>>> infile = StringIO()
>>> outfile = StringIO()
>>> infile.write("""
... 00-50-C2   (hex)        ACME CORPORATION
... ABC000-ABCFFF     (base 16)        ACME CORPORATION
...                 1 MAIN STREET
...                 SPRINGFIELD
...                 UNITED STATES
... """)
182
>>> infile.seek(0)
0
>>> iab_parser = IABIndexParser(infile)
>>> iab_parser.attach(FileIndexer(outfile))
>>> iab_parser.parse()
>>> print(outfile.getvalue())
84683452,1,181
<BLANKLINE>

}}}
