Mercurial > libervia-backend
diff tests/unit/test_ap-gateway.py @ 3735:04ecc8eeb81a
tests (ap-gateway): fix use of outbox URL to get items
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 21 Mar 2022 16:37:19 +0100 |
parents | 6cc39a3b8c14 |
children | f31113777881 |
line wrap: on
line diff
--- 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 )