telepathy-idle: Add a stupid test for Idle sending PING

Will Thompson wjt at kemper.freedesktop.org
Fri Nov 2 04:56:49 PDT 2012


Module: telepathy-idle
Branch: master
Commit: a6e9900f65e250aa1419420708598df23aae0891
URL:    http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=a6e9900f65e250aa1419420708598df23aae0891

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Tue Oct 30 14:09:51 2012 +0000

Add a stupid test for Idle sending PING

---

 tests/twisted/Makefile.am     |    1 +
 tests/twisted/connect/ping.py |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index e750d12..185ffec 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -4,6 +4,7 @@ TWISTED_TESTS = \
 		connect/connect-success-ssl.py \
 		connect/connect-fail.py \
 		connect/connect-fail-ssl.py \
+		connect/ping.py \
 		connect/server-quit-ignore.py \
 		connect/server-quit-noclose.py \
 		connect/socket-closed-after-handshake.py \
diff --git a/tests/twisted/connect/ping.py b/tests/twisted/connect/ping.py
new file mode 100644
index 0000000..7a5b8e0
--- /dev/null
+++ b/tests/twisted/connect/ping.py
@@ -0,0 +1,20 @@
+"""
+Test Idle sending PINGs.
+"""
+
+from idletest import exec_test
+from servicetest import EventPattern, call_async
+
+def test(q, bus, conn, stream):
+    conn.Connect()
+    q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+
+    e = q.expect('stream-PING')
+    timestamp = e.data[0]
+    stream.sendMessage('PONG', timestamp)
+
+if __name__ == '__main__':
+    exec_test(test, params={
+        'keepalive-interval': 1,
+    })
+



More information about the telepathy-commits mailing list