findbits converted to python3 + tests

This commit is contained in:
Philippe Teuwen 2020-02-21 16:45:00 +01:00
commit ba6f58cc05
3 changed files with 28 additions and 29 deletions

5
tools/findbits_test.py Normal file → Executable file
View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from itertools import imap
import unittest, sys, findbits
class TestFindBits(unittest.TestCase):
@ -46,7 +45,7 @@ class TestFindBits(unittest.TestCase):
def commutative_test(self, operation, cases):
self.unary_operation_test(operation, cases)
self.unary_operation_test(operation, imap(reversed, cases))
self.unary_operation_test(operation, map(reversed, cases))
def unary_operation_test(self, operation, cases):
for case_in, case_out in cases: