summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDafydd Harries <dafydd.harries@collabora.co.uk>2009-09-23 16:27:22 +0100
committerDafydd Harries <dafydd.harries@collabora.co.uk>2009-09-23 16:50:29 +0100
commit71714a372cf4e59e219f02d96453944ade6994e5 (patch)
treedc9353992bd8f6404f194dada9c26da09d5e2b90 /tests
parentabbc555fd2959e0bad38c37ee4b5cf2e88720002 (diff)
presence.py: use make_presence()
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/presence/presence.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/tests/twisted/presence/presence.py b/tests/twisted/presence/presence.py
index 901c88cae..2903544e7 100644
--- a/tests/twisted/presence/presence.py
+++ b/tests/twisted/presence/presence.py
@@ -6,7 +6,7 @@ FIXME: test C.I.Presence too
from twisted.words.xish import domish
-from gabbletest import exec_test
+from gabbletest import exec_test, make_presence
from servicetest import EventPattern
import ns
import constants as cs
@@ -28,27 +28,15 @@ def test(q, bus, conn, stream):
item['subscription'] = 'both'
stream.send(event.stanza)
+ stream.send(make_presence('amy@foo.com', show='away', status='At the pub'))
- presence = domish.Element((None, 'presence'))
- presence['from'] = 'amy@foo.com'
- show = presence.addElement((None, 'show'))
- show.addContent('away')
- status = presence.addElement((None, 'status'))
- status.addContent('At the pub')
- stream.send(presence)
-
- event = q.expect('dbus-signal', signal='PresencesChanged',
+ q.expect('dbus-signal', signal='PresencesChanged',
args=[{amy_handle: (3, 'away', 'At the pub')}])
- presence = domish.Element((None, 'presence'))
- presence['from'] = 'amy@foo.com'
- show = presence.addElement((None, 'show'))
- show.addContent('chat')
- status = presence.addElement((None, 'status'))
- status.addContent('I may have been drinking')
- stream.send(presence)
+ stream.send(make_presence(
+ 'amy@foo.com', show='chat', status='I may have been drinking'))
- event = q.expect('dbus-signal', signal='PresencesChanged',
+ q.expect('dbus-signal', signal='PresencesChanged',
args=[{amy_handle: (2, 'chat', 'I may have been drinking')}])
if __name__ == '__main__':