fix multiline tests

This commit is contained in:
Luca Matei Pintilie
2025-11-28 20:30:12 +01:00
committed by mathieui
parent 6993577cbe
commit f2a55c4f27
6 changed files with 11 additions and 17 deletions
@@ -29,7 +29,7 @@ scenario = (
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"
],
[
"/message[@id][@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='\ncoucou']",
"/message[@id][@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='coucou']",
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"
]
),
@@ -51,6 +51,6 @@ scenario = (
expect_unordered(
["/message[@from='#foo%{irc_server_one}/{nick_one}'][@id='the-message-id'][@to='{jid_one}/{resource_one}'][@type='groupchat']/body[text()='a\nb\nc']"],
["/message[@from='#foo%{irc_server_one}/{nick_one}'][@id][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='\na\nb\nc']"],
["/message[@from='#foo%{irc_server_one}/{nick_one}'][@id][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='a\nb\nc']"],
)
)
@@ -11,7 +11,7 @@ scenario = (
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"
],
[
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='\n/me rit en IRC']",
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='/me rit en IRC']",
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"
],
),
+3 -3
View File
@@ -23,14 +23,14 @@ def connection_begin(irc_host, jid, expected_irc_presence=False, fixed_irc_serve
expect_stanza(xpath % ('Connecting to %s:6667 (not encrypted)' % irc_host)),
expect_stanza(xpath % 'Connected to IRC server.'))
if expected_irc_presence:
result += (expect_stanza("/presence[@from='" + irc_host + "@biboumi.localhost']"),)
result += (
expect_stanza("/message/body[text()='irc.localhost: *** Looking up your hostname...']"),
expect_stanza("/message/body[text()='irc.localhost: *** Found your hostname']")
)
if expected_irc_presence:
result += (expect_stanza("/presence[@from='" + irc_host + "@biboumi.localhost']"),)
if login is not None:
result += (expect_stanza("/message/body[text()='irc.localhost: You are now logged in as %s']" % (login,)),)