Mercurial > hg > tvii
comparison tests/test_unique.py @ 68:5916b04d0582
update uniqueness test
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 17 Dec 2017 13:14:31 -0800 |
parents | e1eb45c4763e |
children | 9d55e0299c3f |
comparison
equal
deleted
inserted
replaced
67:4bf2145c16f8 | 68:5916b04d0582 |
---|---|
20 | 20 |
21 def test_negative(self): | 21 def test_negative(self): |
22 """what if a set is not unique?""" | 22 """what if a set is not unique?""" |
23 | 23 |
24 data = [1,2,3,4] | 24 data = [1,2,3,4] |
25 e = None | |
25 try: | 26 try: |
26 unique(data) | 27 unique(data) |
27 assert 1 == 0 | |
28 except NotUnique as e: | 28 except NotUnique as e: |
29 assert (e is not None) | 29 pass |
30 assert isinstance(e, NotUnique) | 30 assert e is not None |
31 assert isinstance(e, NotUnique) | |
31 | 32 |
32 if __name__ == '__main__': | 33 if __name__ == '__main__': |
33 unittest.main() | 34 unittest.main() |