summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-03-17 19:18:24 +0100
committerlouiz’ <louiz@louiz.org>2016-04-22 10:49:06 +0200
commitd57b8bb8c3edc4271a9be3d052a220db09250a7e (patch)
tree826c9893c22628d462394621b85d5b9ec65b9242
parentb32729fb8a5ff5cdbd6c94ad327a09aa19396389 (diff)
downloadbiboumi-d57b8bb8c3edc4271a9be3d052a220db09250a7e.tar.gz
biboumi-d57b8bb8c3edc4271a9be3d052a220db09250a7e.tar.bz2
biboumi-d57b8bb8c3edc4271a9be3d052a220db09250a7e.tar.xz
biboumi-d57b8bb8c3edc4271a9be3d052a220db09250a7e.zip
Trivial formatting
-rw-r--r--tests/end_to_end/__main__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index dbc7c66..7b01a39 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -7,9 +7,10 @@ import signal
import atexit
import sys
from functools import partial
+from slixmpp.xmlstream.matcher.base import MatcherBase
-class MatchAll(slixmpp.xmlstream.matcher.base.MatcherBase):
+class MatchAll(MatcherBase):
"""match everything"""
def match(self, xml):
@@ -80,11 +81,13 @@ class XMPPComponent(slixmpp.BaseXMPP):
self.accepting_server = yield from self.loop.create_server(lambda: self,
"127.0.0.1", "8811", reuse_address=True)
+
def check_xpath(xpath, stanza):
matched = slixmpp.xmlstream.matcher.xpath.MatchXPath(xpath).match(stanza)
if not matched:
raise StanzaError("Received stanza “%s” did not match expected xpath “%s”" % (stanza, self.expected_xpath))
+
class Scenario:
"""Defines a list of actions that are executed in sequence, until one of
them throws an exception, or until the end. An action can be something
@@ -107,7 +110,9 @@ class BiboumiRunner:
self.name = name
self.fd = open("biboumi_%s_output.txt" % (name,), "w")
if with_valgrind:
- self.create = asyncio.create_subprocess_exec("valgrind", "--leak-check=full", "--show-leak-kinds=all", "--errors-for-leak-kinds=all", "--error-exitcode=16", "./biboumi", "test.conf", stdin=None, stdout=self.fd,
+ self.create = asyncio.create_subprocess_exec("valgrind", "--leak-check=full", "--show-leak-kinds=all",
+ "--errors-for-leak-kinds=all", "--error-exitcode=16",
+ "./biboumi", "test.conf", stdin=None, stdout=self.fd,
stderr=self.fd, loop=None, limit=None)
else:
self.create = asyncio.create_subprocess_exec("./biboumi", "test.conf", stdin=None, stdout=self.fd,
@@ -190,6 +195,7 @@ class BiboumiTest:
return not failed
+
confs = {'basic':
"""hostname=biboumi.localhost
password=coucou
@@ -212,7 +218,8 @@ if __name__ == '__main__':
[
partial(expect_stanza, "{jabber:component:accept}handshake"),
partial(send_stanza, "<handshake xmlns='jabber:component:accept'/>"),
- partial(send_stanza, "<presence from='me@example.com/Nick' to='#foo%irc.localhost@biboumi.localhost' />"),
+ partial(send_stanza,
+ "<presence from='me@example.com/Nick' to='#foo%irc.localhost@biboumi.localhost' />"),
partial(expect_stanza, "{jabber:component:accept}message/body"),
]),
)