From d57b8bb8c3edc4271a9be3d052a220db09250a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 17 Mar 2016 19:18:24 +0100 Subject: Trivial formatting --- tests/end_to_end/__main__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/end_to_end/__main__.py') 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, ""), - partial(send_stanza, ""), + partial(send_stanza, + ""), partial(expect_stanza, "{jabber:component:accept}message/body"), ]), ) -- cgit v1.2.3