tornado-openapi3/tests/common.py

22 lines
511 B
Python
Raw Normal View History

2024-10-18 21:04:45 +00:00
import hypothesis.strategies as s
from werkzeug.datastructures import Headers
field_names = s.text(
s.characters(
min_codepoint=33,
max_codepoint=126,
blacklist_categories=["Lu"],
blacklist_characters=":\r\n",
),
min_size=1,
)
field_values = s.text(
s.characters(min_codepoint=0x20, max_codepoint=0x7E, blacklist_characters="; \r\n"),
min_size=1,
)
headers: s.SearchStrategy[Headers] = s.builds(
Headers, s.lists(s.tuples(field_names, field_values))
)