From 7540f6793342aeb1e9cec53208b347ca8a346c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 9 Jun 2016 16:32:23 +0200 Subject: Add some e2e tests to check that private messages come from the right JIDs --- tests/end_to_end/__main__.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index 186ada1..1408ea9 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -610,7 +610,7 @@ if __name__ == '__main__': handshake_sequence(), # First user joins partial(send_stanza, - ""), + ""), connection_sequence("irc.localhost", '{jid_one}/{resource_one}'), partial(expect_stanza, "/message/body[text()='Mode #foo [+nt] by {irc_host_one}']"), @@ -652,6 +652,27 @@ if __name__ == '__main__': partial(send_stanza, "yes"), # The response is received from the in-room JID partial(expect_stanza, "/message[@from='#foo%{irc_server_one}/{nick_two}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='yes']"), + + ## Do the exact same thing, from a different chan, + # to check if the response comes from the right JID + + # Join the virtual channel + partial(send_stanza, + ""), + partial(expect_stanza, + "/presence/muc_user:x/muc_user:status[@code='110']"), + partial(expect_stanza, "/message[@from='%{irc_server_one}'][@type='groupchat']/subject"), + + + # Send a private message, to a in-room JID + partial(send_stanza, "re in private"), + # Message is received with a server-wide JID + partial(expect_stanza, "/message[@from='{lower_nick_one}!{irc_server_one}'][@to='{jid_two}/{resource_one}'][@type='chat']/body[text()='re in private']"), + + # Respond to the message, to the server-wide JID + partial(send_stanza, "re"), + # The response is received from the in-room JID + partial(expect_stanza, "/message[@from='%{irc_server_one}/{nick_two}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='re']"), ] ) ) -- cgit v1.2.3