Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdonovick committed Jul 15, 2019
1 parent 5842b28 commit 3bbb99e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_adt.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def test_enum():
assert issubclass(En1, Enum)
assert isinstance(En1.a, Enum)
assert isinstance(En1.a, En1)
assert En1.is_bound

with pytest.raises(AttributeError):
En1.a.b
Expand Down Expand Up @@ -211,3 +212,15 @@ class _(T):
'''
with pytest.raises(ReservedNameError):
exec(cls_str, l_dict)

@pytest.mark.parametrize("t, base", [
(En1, Enum),
(Pr, Product),
(Su, Sum),
(Tu, Tuple),
])
def test_unbound_t(t, base):
assert t.unbound_t == base
class sub_t(t): pass
with pytest.raises(AttributeError):
sub_t.unbound_t

0 comments on commit 3bbb99e

Please sign in to comment.