From 0280343ced6c520700c3ca508e2d04c6b512d319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sat, 10 Feb 2018 19:51:59 +0100 Subject: =?UTF-8?q?Handle=20the=20=E2=80=9Cafter=E2=80=9D=20RSM=20value=20?= =?UTF-8?q?to=20page=20through=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/end_to_end/__main__.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index 7fa779e..3875a7e 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -2164,6 +2164,30 @@ if __name__ == '__main__': "!/iq//mam:fin[@complete='true']", "/iq//mam:fin")), + # Retrieve the next page, using the “after” thingy + partial(send_stanza, "{last_uuid}"), + + partial(expect_stanza, + ("/message/mam:result[@queryid='qid2']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid2']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='101']") + ), + ] + 47 * [ + partial(expect_stanza, + ("/message/mam:result[@queryid='qid2']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid2']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body") + ), + ] + [ + partial(expect_stanza, + ("/message/mam:result[@queryid='qid2']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid2']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='149']"), + after = partial(save_value, "last_uuid", partial(extract_attribute, "/message/mam:result", "id")) + ), + # And it should not be marked as complete + partial(expect_stanza, + ("/iq[@type='result'][@id='id2'][@from='#foo%{irc_server_one}'][@to='{jid_one}/{resource_one}']", + "/iq/mam:fin/rsm:set/rsm:last[text()='{last_uuid}']", + "/iq//mam:fin[@complete='true']", + "/iq//mam:fin")), ]), Scenario("channel_history_on_fixed_server", [ -- cgit v1.2.3