Changeset View
Changeset View
Standalone View
Standalone View
swh/model/hypothesis_strategies.py
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
@composite | @composite | ||||
def skipped_contents(draw): | def skipped_contents(draw): | ||||
def optional(strategy): | def optional(strategy): | ||||
return one_of(none(), strategy) | return one_of(none(), strategy) | ||||
return draw(builds( | return draw(builds( | ||||
SkippedContent, | SkippedContent, | ||||
length=optional(integers(min_value=0, max_value=2**63-1)), | length=integers(min_value=-1, max_value=2**63-1), | ||||
sha1=optional(sha1()), | sha1=optional(sha1()), | ||||
sha1_git=optional(sha1_git()), | sha1_git=optional(sha1_git()), | ||||
sha256=optional(binary(min_size=32, max_size=32)), | sha256=optional(binary(min_size=32, max_size=32)), | ||||
blake2s256=optional(binary(min_size=32, max_size=32)), | blake2s256=optional(binary(min_size=32, max_size=32)), | ||||
status=just('absent'), | status=just('absent'), | ||||
reason=pgsql_text(), | reason=pgsql_text(), | ||||
)) | )) | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |