diff options
Diffstat (limited to 'tests/inputs/bool/test_bool.py')
-rw-r--r-- | tests/inputs/bool/test_bool.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/inputs/bool/test_bool.py b/tests/inputs/bool/test_bool.py new file mode 100644 index 0000000..f9554ae --- /dev/null +++ b/tests/inputs/bool/test_bool.py @@ -0,0 +1,19 @@ +import pytest + +from tests.output_aristaproto.bool import Test +from tests.output_aristaproto_pydantic.bool import Test as TestPyd + + +def test_value(): + message = Test() + assert not message.value, "Boolean is False by default" + + +def test_pydantic_no_value(): + with pytest.raises(ValueError): + TestPyd() + + +def test_pydantic_value(): + message = Test(value=False) + assert not message.value |