tests: Split the connection sequence into two
We can now insert steps between the two parts
This commit is contained in:
@@ -287,7 +287,7 @@ def handshake_sequence():
|
|||||||
partial(send_stanza, "<handshake xmlns='jabber:component:accept'/>"))
|
partial(send_stanza, "<handshake xmlns='jabber:component:accept'/>"))
|
||||||
|
|
||||||
|
|
||||||
def connection_sequence(irc_host, jid):
|
def connection_begin_sequence(irc_host, jid):
|
||||||
jid = jid.format_map(common_replacements)
|
jid = jid.format_map(common_replacements)
|
||||||
xpath = "/message[@to='" + jid + "'][@from='irc.localhost@biboumi.localhost']/body[text()='%s']"
|
xpath = "/message[@to='" + jid + "'][@from='irc.localhost@biboumi.localhost']/body[text()='%s']"
|
||||||
xpath_re = "/message[@to='" + jid + "'][@from='irc.localhost@biboumi.localhost']/body[re:test(text(), '%s')]"
|
xpath_re = "/message[@to='" + jid + "'][@from='irc.localhost@biboumi.localhost']/body[re:test(text(), '%s')]"
|
||||||
@@ -316,6 +316,14 @@ def connection_sequence(irc_host, jid):
|
|||||||
xpath_re % (r'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$' % irc_host)),
|
xpath_re % (r'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$' % irc_host)),
|
||||||
partial(expect_stanza,
|
partial(expect_stanza,
|
||||||
xpath_re % (r'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$' % irc_host)),
|
xpath_re % (r'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$' % irc_host)),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def connection_end_sequence(irc_host, jid):
|
||||||
|
jid = jid.format_map(common_replacements)
|
||||||
|
xpath = "/message[@to='" + jid + "'][@from='irc.localhost@biboumi.localhost']/body[text()='%s']"
|
||||||
|
xpath_re = "/message[@to='" + jid + "'][@from='irc.localhost@biboumi.localhost']/body[re:test(text(), '%s')]"
|
||||||
|
return (
|
||||||
partial(expect_stanza,
|
partial(expect_stanza,
|
||||||
xpath_re % (r'^%s: Your host is .*$' % irc_host)),
|
xpath_re % (r'^%s: Your host is .*$' % irc_host)),
|
||||||
partial(expect_stanza,
|
partial(expect_stanza,
|
||||||
@@ -339,6 +347,10 @@ def connection_sequence(irc_host, jid):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def connection_sequence(irc_host, jid):
|
||||||
|
return connection_begin_sequence(irc_host, jid) + connection_end_sequence(irc_host, jid)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
atexit.register(asyncio.get_event_loop().close)
|
atexit.register(asyncio.get_event_loop().close)
|
||||||
|
|||||||
Reference in New Issue
Block a user