Changeset View
Changeset View
Standalone View
Standalone View
swh/model/hypothesis_strategies.py
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | return builds( | ||||
entries=lists(directory_entries())) | entries=lists(directory_entries())) | ||||
@composite | @composite | ||||
def contents(draw): | def contents(draw): | ||||
(status, data, reason) = draw(one_of( | (status, data, reason) = draw(one_of( | ||||
tuples(just('visible'), binary(), none()), | tuples(just('visible'), binary(), none()), | ||||
tuples(just('absent'), none(), pgsql_text()), | tuples(just('absent'), none(), pgsql_text()), | ||||
tuples(just('hidden'), none(), none()), | tuples(just('hidden'), binary(), none()), | ||||
)) | )) | ||||
return draw(builds( | return draw(builds( | ||||
Content, | Content, | ||||
length=integers(min_value=0, max_value=2**63-1), | length=integers(min_value=0, max_value=2**63-1), | ||||
sha1=sha1(), | sha1=sha1(), | ||||
sha1_git=sha1_git(), | sha1_git=sha1_git(), | ||||
sha256=binary(min_size=32, max_size=32), | sha256=binary(min_size=32, max_size=32), | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |