from hypothesis.strategies import tuples
from hypothesis.strategies import uuids
+from keks import _byte
from keks import Blob
+from keks import Raw
+from keks import TagTAI64NA
+from keks import TAI64Base
+TagTAI64NAb = _byte(TagTAI64NA)
junk_st = binary(max_size=8)
blobs_st = tuples(integers(1, 20), binary(max_size=60)).map(lambda x: Blob(*x))
unicode_allowed = characters(exclude_characters="\x00", exclude_categories=("Cs",))
text_st = text(alphabet=unicode_allowed, max_size=32)
mapkey_st = text(alphabet=unicode_allowed, min_size=1, max_size=8)
+tai64na_st = tuples(integers(1, 100), integers(1, 100)).map(lambda x: Raw(
+ TagTAI64NAb + (TAI64Base + x[0]).to_bytes(8, "big") + (x[1] + 1).to_bytes(8, "big")
+))
any_st = one_of(
booleans(),
integers(),
uuids(),
datetimes(),
blobs_st,
+ tai64na_st,
)
everything_st = deferred(
lambda: any_st |