/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
contrib/python/pyrsistent/py2/tests/field_test.py
27 строк
686 B
Anton Myagkov
Update ydb version to 24.4 (#4579)
07 фев 2026, 11:59
Не верифицирован
07 фев 2026, 11:59
2c21cae
Код
Авторство
О чём код?
from pyrsistent._compat import Enum from pyrsistent import field, pvector_field # NB: This derives from the internal `pyrsistent._compat.Enum` in order to # simplify coverage across python versions. Since we use # `pyrsistent._compat.Enum` in `pyrsistent`'s implementation, it's useful to # use it in the test coverage as well, for consistency. class TestEnum(Enum): x = 1 y = 2 def test_enum(): f = field(type=TestEnum) assert TestEnum in f.type assert len(f.type) == 1 # This is meant to exercise `_seq_field`. def test_pvector_field_enum_type(): f = pvector_field(TestEnum) assert len(f.type) == 1 assert TestEnum is list(f.type)[0].__type__