Skip to content

Commit

Permalink
Adding working (and not working) tests for issue
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Apr 4, 2018
1 parent 3c5615a commit 8ff4559
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,18 @@ def test_converstion_enum():
assert m.test_conversion_enum(m.ConversionEnum.Convert1) == "ConversionEnum::Convert1"
assert m.test_conversion_enum(m.ConversionEnum("Convert1")) == "ConversionEnum::Convert1"
assert m.test_conversion_enum("Convert1") == "ConversionEnum::Convert1"
assert m.test_conversion_enum(m.ConversionEnum.Convert1) == "ConversionEnum::Convert1"


def test_conversion_enum_raises():
with pytest.raises(ValueError) as excinfo:
m.ConversionEnum("Convert0")
assert str(excinfo.value) == "\"Convert0\" is not a valid value for enum type ConversionEnum"


def test_conversion_enum_raises_implicit():
with pytest.raises(ValueError) as excinfo:
m.test_conversion_enum("Convert0")
assert str(excinfo.value) == "\"Convert0\" is not a valid value for enum type ConversionEnum"


def test_scoped_enum():
Expand Down

0 comments on commit 8ff4559

Please sign in to comment.