Changeset View
Changeset View
Standalone View
Standalone View
swh/model/hypothesis_strategies.py
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
def origin_visits(): | def origin_visits(): | ||||
return builds( | return builds( | ||||
OriginVisit, | OriginVisit, | ||||
visit=integers(0, 1000), | visit=integers(0, 1000), | ||||
origin=urls(), | origin=urls(), | ||||
status=sampled_from(['ongoing', 'full', 'partial']), | status=sampled_from(['ongoing', 'full', 'partial']), | ||||
type=pgsql_text(), | type=sampled_from(['git', 'svn', 'hg', 'npm', 'pypi']), | ||||
snapshot=optional(sha1_git())) | snapshot=optional(sha1_git())) | ||||
@composite | @composite | ||||
def releases(draw): | def releases(draw): | ||||
(date, author) = draw(one_of( | (date, author) = draw(one_of( | ||||
tuples(none(), none()), | tuples(none(), none()), | ||||
tuples(timestamps_with_timezone(), persons()))) | tuples(timestamps_with_timezone(), persons()))) | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |