Implemented LFSR generator with tests and CLI integration

This commit is contained in:
AdrienCos 2019-06-04 15:28:02 -04:00 committed by Adrien Cosson
parent bf094c0361
commit 9f032fffbc
4 changed files with 325 additions and 0 deletions

View file

@ -128,6 +128,13 @@ class TestGenerators(unittest.TestCase):
self.assertEqual(next(gen), int(f.readline()))
self.assertEqual(next(gen), int(f.readline()))
def test_LFSR(self):
""" Test the LFSR generator
"""
with open('./tests/expected-results/LFSR', 'r') as f:
self.assertEqual(tuple(itertools.islice(generators.LFSR(2**8), 256)),
tuple(int(line) for line in f))
if __name__ == '__main__':
unittest.main()