[Telepathy-commits] [telepathy-haze/master] Add a test adapted from Gabble

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Jan 16 01:46:32 PST 2009


---
 tests/twisted/Makefile.am        |    3 ++-
 tests/twisted/connect/success.py |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)
 create mode 100644 tests/twisted/connect/success.py

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 22239d8..75d76c3 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -1,4 +1,5 @@
-TWISTED_TESTS =
+TWISTED_TESTS = \
+	connect/success.py
 
 TESTS =
 
diff --git a/tests/twisted/connect/success.py b/tests/twisted/connect/success.py
new file mode 100644
index 0000000..20e8d30
--- /dev/null
+++ b/tests/twisted/connect/success.py
@@ -0,0 +1,27 @@
+
+"""
+Test connecting to a server.
+"""
+
+from hazetest import exec_test
+
+def test(q, bus, conn, stream):
+    conn.Connect()
+    q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+    q.expect('stream-authenticated')
+
+    # FIXME: unlike Gabble, Haze does not signal a presence update to
+    # available during connect
+    #q.expect('dbus-signal', signal='PresenceUpdate',
+    #    args=[{1L: (0L, {u'available': {}})}])
+
+    # FIXME: Haze currently signals status change reason NONE, not REQUESTED
+    q.expect('dbus-signal', signal='StatusChanged', args=[0, 0])
+
+    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