From 4a2a280d76e45e165d5c4657f4a46eebf71594bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 13 Feb 2018 03:51:03 +0100 Subject: Support the element in MAM requests --- tests/end_to_end/__main__.py | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'tests/end_to_end') diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index 590c2c8..9569321 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -2190,7 +2190,48 @@ if __name__ == '__main__': # Send a request with a non-existing ID set as the “after” value. partial(send_stanza, "DUMMY_ID"), - partial(expect_stanza, "/iq[@id='id3'][@type='error']/error[@type='cancel']/stanza:feature-not-implemented") + partial(expect_stanza, "/iq[@id='id3'][@type='error']/error[@type='cancel']/stanza:item-not-found"), + + # Request the last page just BEFORE the last message in the archive + partial(send_stanza, ""), + + partial(expect_stanza, + ("/message/mam:result[@queryid='qid3']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid3']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='50']") + ), + ] + 98 * [ + partial(expect_stanza, + ("/message/mam:result[@queryid='qid3']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid3']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body") + ), + ] + [ + partial(expect_stanza, + ("/message/mam:result[@queryid='qid3']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid3']/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")) + ), + partial(expect_stanza, + ("/iq[@type='result'][@id='id3'][@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")), + + # Do the same thing, but with a limit value. + partial(send_stanza, "{last_uuid}2"), + partial(expect_stanza, + ("/message/mam:result[@queryid='qid4']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid4']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='147']") + ), + partial(expect_stanza, + ("/message/mam:result[@queryid='qid4']/forward:forwarded/delay:delay", + "/message/mam:result[@queryid='qid4']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='148']"), + after = partial(save_value, "last_uuid", partial(extract_attribute, "/message/mam:result", "id")) + ), + partial(expect_stanza, + ("/iq[@type='result'][@id='id4'][@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