Page MenuHomeSoftware Heritage

D1389.diff
No OneTemporary

D1389.diff

diff --git a/swh/web/tests/strategies.py b/swh/web/tests/strategies.py
--- a/swh/web/tests/strategies.py
+++ b/swh/web/tests/strategies.py
@@ -16,10 +16,8 @@
from swh.model.hashutil import hash_to_hex, hash_to_bytes
from swh.model.identifiers import directory_identifier
+from swh.model.hypothesis_strategies import origins, snapshots
from swh.storage.algos.revisions_walker import get_revisions_walker
-from swh.model.hypothesis_strategies import (
- origins as new_origin_strategy, snapshots as new_snapshot
-)
from swh.web.tests.data import get_tests_data
# Module dedicated to the generation of input data for tests through
@@ -247,7 +245,7 @@
Hypothesis strategy returning a random origin not ingested
into the test archive.
"""
- return new_origin_strategy().map(lambda origin: origin.to_dict()).filter(
+ return origins().map(lambda origin: origin.to_dict()).filter(
lambda origin: storage.origin_get([origin])[0] is None)
@@ -388,7 +386,7 @@
def new_snapshots(nb_snapshots=None):
min_size = nb_snapshots if nb_snapshots else 2
max_size = nb_snapshots if nb_snapshots else 8
- return lists(new_snapshot(min_size=2, max_size=10, only_objects=True)
+ return lists(snapshots(min_size=2, max_size=10, only_objects=True)
.map(lambda snp: snp.to_dict()),
min_size=min_size, max_size=max_size)

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 9:15 PM (17 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3228976

Event Timeline