Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/strategies.py
Show First 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | |||||
def unknown_revision(): | def unknown_revision(): | ||||
""" | """ | ||||
Hypothesis strategy returning a random revision not ingested | Hypothesis strategy returning a random revision not ingested | ||||
into the test archive. | into the test archive. | ||||
""" | """ | ||||
return sha1().filter( | return sha1().filter( | ||||
lambda s: next(get_tests_data()["storage"].revision_get([hash_to_bytes(s)])) | lambda s: get_tests_data()["storage"].revision_get([hash_to_bytes(s)])[0] | ||||
is None | is None | ||||
) | ) | ||||
@composite | @composite | ||||
def new_person(draw): | def new_person(draw): | ||||
""" | """ | ||||
Hypothesis strategy returning random raw swh person data. | Hypothesis strategy returning random raw swh person data. | ||||
▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines |