File: test_validators.py

package info (click to toggle)
organize 3.3.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,540 kB
  • sloc: python: 5,837; makefile: 4
file content (10 lines) | stat: -rw-r--r-- 309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from pydantic.type_adapter import TypeAdapter

from organize.validators import FlatList


def test_flatlist():
    ta = TypeAdapter(FlatList[int])
    v = ta.validate_python([1, 2, [10, 11, [12, 23]], 3, [4, 5, 6]])
    assert v == [1, 2, 10, 11, 12, 23, 3, 4, 5, 6]
    assert ta.validate_python(None) == []