Changeset View
Changeset View
Standalone View
Standalone View
swh/model/hypothesis_strategies.py
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | 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(), text()), | tuples(just('absent'), none(), text()), | ||||
tuples(just('hidden'), none(), none()), | tuples(just('hidden'), none(), none()), | ||||
)) | )) | ||||
return draw(builds( | return draw(builds( | ||||
Content, | Content, | ||||
length=integers(0), | 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), | ||||
blake2s256=binary(min_size=32, max_size=32), | blake2s256=binary(min_size=32, max_size=32), | ||||
status=just(status), | status=just(status), | ||||
data=just(data), | data=just(data), | ||||
reason=just(reason), | reason=just(reason), | ||||
)) | )) | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |