diff options
author | louiz’ <louiz@louiz.org> | 2016-06-09 16:32:23 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-06-09 16:32:23 +0200 |
commit | 7540f6793342aeb1e9cec53208b347ca8a346c36 (patch) | |
tree | 11945614b51e524bc1e89ba92ef14c1e11358a65 | |
parent | 199f010f523b1613afcc760f2b9aedc1888ab7a1 (diff) | |
download | biboumi-7540f6793342aeb1e9cec53208b347ca8a346c36.tar.gz biboumi-7540f6793342aeb1e9cec53208b347ca8a346c36.tar.bz2 biboumi-7540f6793342aeb1e9cec53208b347ca8a346c36.tar.xz biboumi-7540f6793342aeb1e9cec53208b347ca8a346c36.zip |
Add some e2e tests to check that private messages come from the right JIDs
-rw-r--r-- | tests/end_to_end/__main__.py | 23 |
1 files changed, 22 insertions, 1 deletions
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, - "<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), + "<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), 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, "<message from='{jid_two}/{resource_one}' to='{lower_nick_one}!{irc_server_one}' type='chat'><body>yes</body></message>"), # 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, + "<presence from='{jid_one}/{resource_one}' to='%{irc_server_one}/{nick_one}' />"), + 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, "<message from='{jid_one}/{resource_one}' to='%{irc_server_one}/{nick_two}' type='chat'><body>re in private</body></message>"), + # 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, "<message from='{jid_two}/{resource_one}' to='{lower_nick_one}!{irc_server_one}' type='chat'><body>re</body></message>"), + # 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']"), ] ) ) |