~singpolyma/biboumi

7ca1b33ae39360ae7982bf862ace1f1088e11067 — louiz’ 3 years ago cedf441
Add a test for MAM without an “end” value
1 files changed, 20 insertions(+), 0 deletions(-)

M tests/end_to_end/scenarios/mam_with_timestamps.py
M tests/end_to_end/scenarios/mam_with_timestamps.py => tests/end_to_end/scenarios/mam_with_timestamps.py +20 -0
@@ 40,4 40,24 @@ scenario = (

    expect_stanza("/iq[@type='result'][@id='id8'][@from='#foo%{irc_server_one}'][@to='{jid_one}/{resource_one}']",
                  "/iq/mam:fin[@complete='true']/rsm:set"),

    # Try the same thing, but only with the 'start' value, omitting the end
    send_stanza("""<iq from='{jid_one}/{resource_one}' id='id888' to='#foo%{irc_server_one}' type='set'>
                      <query queryid='qid17' xmlns='urn:xmpp:mam:2'>
                          <x type='submit' xmlns='jabber:x:data'>
                              <field type='hidden' var='FORM_TYPE' xmlns='jabber:x:data'><value xmlns='jabber:x:data'>urn:xmpp:mam:2</value></field>
                              <field var='start' xmlns='jabber:x:data'><value xmlns='jabber:x:data'>{first_timestamp}</value></field>
                          </x>
                       </query>
                   </iq>"""),

    expect_stanza("/message/mam:result[@queryid='qid17']/forward:forwarded/delay:delay",
                  "/message/mam:result/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='coucou 3']"),

    expect_stanza("/message/mam:result[@queryid='qid17']/forward:forwarded/delay:delay",
                  "/message/mam:result/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='coucou 4']"),

    expect_stanza("/iq[@type='result'][@id='id888'][@from='#foo%{irc_server_one}'][@to='{jid_one}/{resource_one}']",
                  "/iq/mam:fin[@complete='true']/rsm:set"),

)