Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066195
D3644.id12828.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D3644.id12828.diff
View Options
diff --git a/swh/storage/tests/test_storage.py b/swh/storage/tests/test_storage.py
--- a/swh/storage/tests/test_storage.py
+++ b/swh/storage/tests/test_storage.py
@@ -1231,7 +1231,13 @@
assert actual_page.next_page_token is None
assert actual_page.results == [ov3]
- next_page_token = str(ov1.visit)
+ # order asc, no token, limit
+ actual_page = swh_storage.origin_visit_get(origin.url, limit=1)
+ next_page_token = actual_page.next_page_token
+ assert next_page_token is not None
+ assert actual_page.results == [ov1]
+
+ # order asc, token, no limit
actual_page = swh_storage.origin_visit_get(
origin.url, page_token=next_page_token
)
@@ -1245,7 +1251,13 @@
assert actual_page.next_page_token is None
assert actual_page.results == [ov2, ov3]
- next_page_token = str(ov2.visit)
+ actual_page = swh_storage.origin_visit_get(
+ origin.url, page_token=next_page_token, limit=1
+ )
+ next_page_token = actual_page.next_page_token
+ assert next_page_token is not None
+ assert actual_page.results == [ov2]
+
actual_page = swh_storage.origin_visit_get(
origin.url, page_token=next_page_token, limit=1
)
@@ -1265,14 +1277,22 @@
assert next_page_token is not None
assert actual_page.results == [ov3, ov2]
+ # order desc, token, no limit
actual_page = swh_storage.origin_visit_get(
origin.url, page_token=next_page_token, order=ListOrder.DESC
)
assert actual_page.next_page_token is None
assert actual_page.results == [ov1]
+ # order desc, no token, limit
+ actual_page = swh_storage.origin_visit_get(
+ origin.url, limit=1, order=ListOrder.DESC
+ )
+ next_page_token = actual_page.next_page_token
+ assert next_page_token is not None
+ assert actual_page.results == [ov3]
+
# order desc, token, no limit
- next_page_token = str(ov3.visit)
actual_page = swh_storage.origin_visit_get(
origin.url, page_token=next_page_token, order=ListOrder.DESC
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 12:30 AM (8 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3224285
Attached To
D3644: test_origin_visit_get_all: Use tokens as opaque values.
Event Timeline
Log In to Comment