[telepathy-gabble/master] olpc-buddy-search.py: test that BuddyInfo.GetProperties is completed when conn disconnects

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Sep 24 08:14:25 PDT 2009


This is to test that D-Bus calls are completed if they are waiting for
a PEP IQ reply and the connection is disconnected before they receive
it.
---
 tests/twisted/olpc/olpc-buddy-search.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/olpc/olpc-buddy-search.py b/tests/twisted/olpc/olpc-buddy-search.py
index a18a44b..84c18e0 100644
--- a/tests/twisted/olpc/olpc-buddy-search.py
+++ b/tests/twisted/olpc/olpc-buddy-search.py
@@ -5,7 +5,7 @@ test OLPC search buddy
 import dbus
 
 from servicetest import call_async, EventPattern
-from gabbletest import exec_test, make_result_iq, acknowledge_iq
+from gabbletest import exec_test, make_result_iq, acknowledge_iq, disconnect_conn
 
 from twisted.words.xish import xpath
 from twisted.words.protocols.jabber.client import IQ
@@ -431,5 +431,12 @@ def test(q, bus, conn, stream):
     assert props['org.laptop.Telepathy.Channel.Type.BuddyView.Properties'] == dbus.Dictionary({'color': '#AABBCC,#001122'}, signature='sv')
     assert props['org.laptop.Telepathy.Channel.Type.BuddyView.Alias'] == 'jean'
 
+    # Make a request and disconnect before it's finished. D-Bus call should
+    # be terminated with an error
+    marc_handle = conn.RequestHandles(cs.HT_CONTACT, ['marc at foo.com'])[0]
+    call_async(q, buddy_info_iface, 'GetProperties', marc_handle)
+
+    disconnect_conn(q, conn, stream, [], [EventPattern('dbus-error', method='GetProperties')])
+
 if __name__ == '__main__':
     exec_test(test)
-- 
1.5.6.5




More information about the telepathy-commits mailing list