File: test_bool.py

package info (click to toggle)
python-aristaproto 1.2%2B20240521-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,484 kB
  • sloc: python: 5,915; java: 106; xml: 84; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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