e2e: Fix some logic in check_list_of_xpath
This commit is contained in:
@@ -151,14 +151,13 @@ def check_list_of_xpath(list_of_xpaths, xmpp, stanza):
|
|||||||
found = None
|
found = None
|
||||||
for i, xpaths in enumerate(list_of_xpaths):
|
for i, xpaths in enumerate(list_of_xpaths):
|
||||||
if all_xpaths_match(stanza, xpaths):
|
if all_xpaths_match(stanza, xpaths):
|
||||||
found = i
|
found = True
|
||||||
|
list_of_xpaths.pop(i)
|
||||||
break
|
break
|
||||||
|
|
||||||
if found is None:
|
if not found:
|
||||||
raise StanzaError("Received stanza “%s” did not match any of the expected xpaths:\n%s" % (stanza, list_of_xpaths))
|
raise StanzaError("Received stanza “%s” did not match any of the expected xpaths:\n%s" % (stanza, list_of_xpaths))
|
||||||
|
|
||||||
list_of_xpaths.pop(i)
|
|
||||||
|
|
||||||
if list_of_xpaths:
|
if list_of_xpaths:
|
||||||
step = partial(expect_unordered_already_formatted, list_of_xpaths)
|
step = partial(expect_unordered_already_formatted, list_of_xpaths)
|
||||||
xmpp.scenario.steps.insert(0, step)
|
xmpp.scenario.steps.insert(0, step)
|
||||||
|
|||||||
Reference in New Issue
Block a user