~singpolyma/biboumi

ref: 8013bb1cfecf410466370c5d337490e30c02ced1 biboumi/tests/end_to_end/scenarios/channel_history.py -rw-r--r-- 1.2 KiB
8013bb1c — louiz’ And modify the tests to work, by adding the <x/> node in all join presences 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from scenarios import *

scenario = (
    scenarios.simple_channel_join.scenario,

    # Send one channel message
    send_stanza("<message from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}' type='groupchat'><body>coucou</body></message>"),
    expect_stanza("/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_one}/{resource_one}'][@type='groupchat']/body[text()='coucou']"),

    # Second user joins
    send_stanza("<presence from='{jid_one}/{resource_two}' to='#foo%{irc_server_one}/{nick_one}' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"),
    expect_stanza("/presence[@to='{jid_one}/{resource_two}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@jid='{lower_nick_one}%{irc_server_one}/~{nick_one}@localhost'][@role='moderator']",
                  "/presence/muc_user:x/muc_user:status[@code='110']"),
    # Receive the history message
    expect_stanza("/message[@from='#foo%{irc_server_one}/{nick_one}']/body[text()='coucou']",
                  "/message/delay:delay[@from='#foo%{irc_server_one}']"),
    expect_stanza("/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
)