diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-10-30 14:09:51 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-10-30 14:10:14 +0000 |
commit | a6e9900f65e250aa1419420708598df23aae0891 (patch) | |
tree | f73db680e4caaeed844ba54010ec73fee28b88c9 | |
parent | 39ed6a0d707397fa13ba6d19580d257b7b2df8e2 (diff) |
Add a stupid test for Idle sending PING
-rw-r--r-- | tests/twisted/Makefile.am | 1 | ||||
-rw-r--r-- | 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, + }) + |