From 4a9842f855f83d695b05d3558fe98fc547a6d3b0 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Mon, 25 Apr 2011 10:43:37 +0100 Subject: saluttest: add missing bits from gabbletest This should have appeared before, I missed it. Signed-off-by: Jonny Lamb --- tests/twisted/saluttest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/twisted/saluttest.py b/tests/twisted/saluttest.py index 0193ab7..0ab6d3c 100644 --- a/tests/twisted/saluttest.py +++ b/tests/twisted/saluttest.py @@ -14,6 +14,7 @@ from salutservicetest import call_async, EventPattern from twisted.internet import reactor import salutconstants as cs from twisted.words.protocols.jabber.client import IQ +from twisted.words.xish import domish, xpath import ns import dbus @@ -209,6 +210,16 @@ def wait_for_contact_in_publish(q, bus, conn, contact_name): return handle +def _elem_add(elem, *children): + for child in children: + if isinstance(child, domish.Element): + elem.addChild(child) + elif isinstance(child, unicode): + elem.addContent(child) + else: + raise ValueError( + 'invalid child object %r (must be element or unicode)', child) + def elem(a, b=None, attrs={}, **kw): r""" >>> elem('foo')().toXml() -- cgit v1.2.3