Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/strategies.py
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Lines | |||||
def origin_with_multiple_visits(): | def origin_with_multiple_visits(): | ||||
""" | """ | ||||
Hypothesis strategy returning a random origin ingested | Hypothesis strategy returning a random origin ingested | ||||
into the test archive. | into the test archive. | ||||
""" | """ | ||||
ret = [] | ret = [] | ||||
tests_data = get_tests_data() | tests_data = get_tests_data() | ||||
storage = tests_data["storage"] | |||||
for origin in tests_data["origins"]: | for origin in tests_data["origins"]: | ||||
visits = list(tests_data["storage"].origin_visit_get(origin["url"])) | visit_page = storage.origin_visit_get(origin["url"]) | ||||
if len(visits) > 1: | if len(visit_page.results) > 1: | ||||
ret.append(origin) | ret.append(origin) | ||||
return sampled_from(ret) | return sampled_from(ret) | ||||
def origin_with_releases(): | def origin_with_releases(): | ||||
""" | """ | ||||
Hypothesis strategy returning a random origin ingested | Hypothesis strategy returning a random origin ingested | ||||
into the test archive. | into the test archive. | ||||
▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines |