[telepathy-gabble/master] test-location.py: test location update
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Aug 7 03:55:07 PDT 2009
---
tests/twisted/test-location.py | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/tests/twisted/test-location.py b/tests/twisted/test-location.py
index c38cc0f..ab7fc72 100644
--- a/tests/twisted/test-location.py
+++ b/tests/twisted/test-location.py
@@ -2,7 +2,7 @@ import dbus
import time
import datetime
-from gabbletest import exec_test, make_result_iq
+from gabbletest import exec_test, make_result_iq, elem
from servicetest import call_async, EventPattern, assertEquals, assertLength
from twisted.words.xish import xpath
@@ -182,5 +182,25 @@ def test(q, bus, conn, stream):
else:
assert False
+ # Bob updates his location
+ message = elem('message', from_='bob at foo.com')(
+ elem((ns.PUBSUB + "#event"), 'event')(
+ elem('items', node=ns.GEOLOC)(
+ elem('item', id='12345')(
+ elem(ns.GEOLOC, 'geoloc')(
+ elem ('country') (u'France')
+ )
+ )
+ )
+ )
+ )
+ stream.send(message)
+
+ update_event = q.expect('dbus-signal', signal='LocationUpdated')
+ handle, location = update_event.args
+ assertEquals(handle, bob_handle)
+ assertLength(1, location)
+ assertEquals(location['country'], 'France')
+
if __name__ == '__main__':
exec_test(test)
--
1.5.6.5
More information about the telepathy-commits
mailing list