diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-04-25 10:43:37 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-04-25 10:43:50 +0100 |
commit | 4a9842f855f83d695b05d3558fe98fc547a6d3b0 (patch) | |
tree | acb63125b885fdcb9d902c85a9b612bb3da629d8 | |
parent | 4ff8c6b9fdadbda4bad0c9595262aa59cddaf23e (diff) |
saluttest: add missing bits from gabbletest
This should have appeared before, I missed it.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | tests/twisted/saluttest.py | 11 |
1 files changed, 11 insertions, 0 deletions
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() |