summaryrefslogtreecommitdiff
path: root/tests/end_to_end/functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/end_to_end/functions.py')
-rw-r--r--tests/end_to_end/functions.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/end_to_end/functions.py b/tests/end_to_end/functions.py
index 176dca5..3a21fcf 100644
--- a/tests/end_to_end/functions.py
+++ b/tests/end_to_end/functions.py
@@ -18,10 +18,10 @@ common_replacements = {
'jid_one': 'first@example.com',
'jid_two': 'second@example.com',
'jid_admin': 'admin@example.com',
- 'nick_two': 'Bobby',
- 'nick_three': 'Bernard',
+ 'nick_two': 'Nick2',
+ 'nick_three': 'Nick3',
'lower_nick_one': 'nick',
- 'lower_nick_two': 'bobby',
+ 'lower_nick_two': 'nick2',
}
class SkipStepError(Exception):
@@ -127,7 +127,9 @@ def expect_stanza(*args, optional=False, after=None):
replacements = common_replacements
replacements.update(xmpp.saved_values)
check_func = check_xpath if not optional else check_xpath_optional
- xmpp.stanza_checker = partial(check_func, [xpath.format_map(replacements) for xpath in xpaths], xmpp, after)
+ formatted_xpaths = [xpath.format_map(replacements) for xpath in xpaths]
+ xmpp.stanza_checker = partial(check_func, formatted_xpaths, xmpp, after)
+ xmpp.timeout_handler = asyncio.get_event_loop().call_later(10, partial(xmpp.on_timeout, formatted_xpaths))
return partial(f, *args, optional=optional, after=after)
def send_stanza(stanza):
@@ -148,6 +150,7 @@ def expect_unordered(*args):
formatted_xpaths.append(formatted_xpath)
formatted_list_of_xpaths.append(tuple(formatted_xpaths))
expect_unordered_already_formatted(formatted_list_of_xpaths, xmpp, biboumi)
+ xmpp.timeout_handler = asyncio.get_event_loop().call_later(10, partial(xmpp.on_timeout, formatted_list_of_xpaths))
return partial(f, *args)
def expect_unordered_already_formatted(formatted_list_of_xpaths, xmpp, biboumi):