Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/storage_tests.py
Show First 20 Lines • Show All 2,661 Lines • ▼ Show 20 Lines | def test_origin_visit_status_get_random(self, swh_storage, sample_data): | ||||
assert random_ovs.type is not None | assert random_ovs.type is not None | ||||
def test_origin_visit_status_get_random_nothing_found( | def test_origin_visit_status_get_random_nothing_found( | ||||
self, swh_storage, sample_data | self, swh_storage, sample_data | ||||
): | ): | ||||
origins = sample_data.origins | origins = sample_data.origins | ||||
swh_storage.origin_add(origins) | swh_storage.origin_add(origins) | ||||
visit_type = "hg" | visit_type = "hg" | ||||
# Add some visits outside of the random generation selection so nothing | # Add some visits older than 3 months so they are excluded from the random | ||||
# will be found by the random selection | # selection | ||||
visits = self._generate_random_visits(nb_visits=3, start=13, end=24) | visits = self._generate_random_visits(nb_visits=100, start=14, end=24) | ||||
for origin in origins: | for origin in origins: | ||||
for date_visit in visits: | for date_visit in visits: | ||||
visit = swh_storage.origin_visit_add( | visit = swh_storage.origin_visit_add( | ||||
[ | [ | ||||
OriginVisit( | OriginVisit( | ||||
origin=origin.url, | origin=origin.url, | ||||
date=date_visit, | date=date_visit, | ||||
type=visit_type, | type=visit_type, | ||||
▲ Show 20 Lines • Show All 2,953 Lines • Show Last 20 Lines |