# HG changeset patch # User Goffi # Date 1647877039 -3600 # Node ID 04ecc8eeb81a8d9056f98df69d1d6cec8303fd08 # Parent 643622ff1492e988ef9b9e7644d895711aa8f539 tests (ap-gateway): fix use of outbox URL to get items diff -r 643622ff1492 -r 04ecc8eeb81a tests/unit/test_ap-gateway.py --- a/tests/unit/test_ap-gateway.py Mon Jan 31 18:35:52 2022 +0100 +++ b/tests/unit/test_ap-gateway.py Mon Mar 21 16:37:19 2022 +0100 @@ -407,7 +407,9 @@ monkeypatch.setattr(plugin_comp_ap_gateway.treq, "json_content", mock_treq_json) monkeypatch.setattr(ap_gateway, "apGet", mock_ap_get) - items, rsm_resp = await ap_gateway.getAPItems(TEST_AP_ACCOUNT, 2) + actor_data = await ap_gateway.getAPActorDataFromId(TEST_AP_ACCOUNT) + outbox = await ap_gateway.apGetObject(actor_data, "outbox") + items, rsm_resp = await ap_gateway.getAPItems(outbox, 2) assert rsm_resp.count == 4 assert rsm_resp.index == 0 @@ -437,7 +439,7 @@ assert str(items[1].entry.published) == "2021-12-16T17:26:03Z" items, rsm_resp = await ap_gateway.getAPItems( - TEST_AP_ACCOUNT, + outbox, max_items=2, after_id="https://example.org/users/test_user/statuses/3", ) @@ -470,7 +472,7 @@ assert str(items[1].entry.published) == "2021-12-16T17:28:03Z" items, rsm_resp = await ap_gateway.getAPItems( - TEST_AP_ACCOUNT, + outbox, max_items=1, start_index=2 ) @@ -489,7 +491,7 @@ assert str(items[0].entry.published) == "2021-12-16T17:27:03Z" items, rsm_resp = await ap_gateway.getAPItems( - TEST_AP_ACCOUNT, + outbox, max_items=3, chronological_pagination=False )