Changeset View
Changeset View
Standalone View
Standalone View
swh/core/db/tests/test_db.py
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | Field( | ||||
in_wrapper=psycopg2.extras.Json, | in_wrapper=psycopg2.extras.Json, | ||||
), | ), | ||||
Field( | Field( | ||||
"intenum", | "intenum", | ||||
"int", | "int", | ||||
TestIntEnum.foo, | TestIntEnum.foo, | ||||
strategies.sampled_from(TestIntEnum), | strategies.sampled_from(TestIntEnum), | ||||
in_wrapper=int, | in_wrapper=int, | ||||
out_converter=TestIntEnum, | out_converter=lambda x: TestIntEnum(x), # lambda needed by mypy | ||||
), | ), | ||||
Field("uuid", "uuid", uuid.uuid4(), strategies.uuids()), | Field("uuid", "uuid", uuid.uuid4(), strategies.uuids()), | ||||
Field( | Field( | ||||
"text_list", | "text_list", | ||||
"text[]", | "text[]", | ||||
# All the funky corner cases | # All the funky corner cases | ||||
["null", "NULL", None, "\\", "\t", "\n", "\r", " ", "'", ",", '"', "{", "}"], | ["null", "NULL", None, "\\", "\t", "\n", "\r", " ", "'", ",", '"', "{", "}"], | ||||
strategies.lists(pg_text, min_size=0, max_size=5), | strategies.lists(pg_text, min_size=0, max_size=5), | ||||
▲ Show 20 Lines • Show All 273 Lines • Show Last 20 Lines |