[Telepathy-commits] [telepathy-gabble/master] Move test to tests/twisted
Alban Crequy
alban.crequy at collabora.co.uk
Sun Feb 1 05:23:55 PST 2009
---
tests/test-location.py | 46 ----------------------------------------
tests/twisted/test-location.py | 46 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 46 deletions(-)
delete mode 100644 tests/test-location.py
create mode 100644 tests/twisted/test-location.py
diff --git a/tests/test-location.py b/tests/test-location.py
deleted file mode 100644
index 43845aa..0000000
--- a/tests/test-location.py
+++ /dev/null
@@ -1,46 +0,0 @@
-
-from gabbletest import exec_test, make_result_iq
-from servicetest import call_async
-
-def test(q, bus, conn, stream):
- # hack
- import dbus
- conn.interfaces['Location'] = \
- dbus.Interface(conn, 'org.freedesktop.Telepathy.Location')
-
- conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
-
- # discard activities request
- q.expect('stream-iq', iq_type='set',
- query_ns='http://jabber.org/protocol/pubsub')
-
- conn.Location.SetLocation({
- 'lat': dbus.Double(0.0, variant_level=1), 'lon': 0.0})
-
- event = q.expect('stream-iq', iq_type='set',
- query_ns='http://jabber.org/protocol/pubsub')
-
- handle = conn.RequestHandles(1, ['bob at foo.com'])[0]
- call_async(q, conn.Location, 'GetLocations', [handle])
-
- # XXX this is made up
- event = q.expect('stream-iq', iq_type='get',
- query_ns='http://jabber.org/protocol/pubsub')
- result = make_result_iq(stream, event.stanza)
- result['from'] = 'bob at foo.com'
- query = result.firstChildElement()
- geoloc = query.addElement(('http://jabber.org/protocol/geoloc', 'geoloc'))
- geoloc.addElement('lat', content='1.234')
- geoloc.addElement('lon', content='5.678')
- stream.send(result)
-
- q.expect('dbus-return', method='GetLocations')
-
- conn.Disconnect()
- q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
- return True
-
-if __name__ == '__main__':
- exec_test(test)
-
diff --git a/tests/twisted/test-location.py b/tests/twisted/test-location.py
new file mode 100644
index 0000000..43845aa
--- /dev/null
+++ b/tests/twisted/test-location.py
@@ -0,0 +1,46 @@
+
+from gabbletest import exec_test, make_result_iq
+from servicetest import call_async
+
+def test(q, bus, conn, stream):
+ # hack
+ import dbus
+ conn.interfaces['Location'] = \
+ dbus.Interface(conn, 'org.freedesktop.Telepathy.Location')
+
+ conn.Connect()
+ q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+
+ # discard activities request
+ q.expect('stream-iq', iq_type='set',
+ query_ns='http://jabber.org/protocol/pubsub')
+
+ conn.Location.SetLocation({
+ 'lat': dbus.Double(0.0, variant_level=1), 'lon': 0.0})
+
+ event = q.expect('stream-iq', iq_type='set',
+ query_ns='http://jabber.org/protocol/pubsub')
+
+ handle = conn.RequestHandles(1, ['bob at foo.com'])[0]
+ call_async(q, conn.Location, 'GetLocations', [handle])
+
+ # XXX this is made up
+ event = q.expect('stream-iq', iq_type='get',
+ query_ns='http://jabber.org/protocol/pubsub')
+ result = make_result_iq(stream, event.stanza)
+ result['from'] = 'bob at foo.com'
+ query = result.firstChildElement()
+ geoloc = query.addElement(('http://jabber.org/protocol/geoloc', 'geoloc'))
+ geoloc.addElement('lat', content='1.234')
+ geoloc.addElement('lon', content='5.678')
+ stream.send(result)
+
+ q.expect('dbus-return', method='GetLocations')
+
+ conn.Disconnect()
+ q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
+ return True
+
+if __name__ == '__main__':
+ exec_test(test)
+
--
1.5.6.5
More information about the Telepathy-commits
mailing list