[telepathy-gabble/master] extended.py: test that the same search key is not added more than once

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Aug 25 06:35:05 PDT 2009


---
 tests/twisted/search/extended.py |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/search/extended.py b/tests/twisted/search/extended.py
index 3eed10c..614f942 100644
--- a/tests/twisted/search/extended.py
+++ b/tests/twisted/search/extended.py
@@ -28,7 +28,7 @@ def test(q, bus, conn, stream):
 
     requests = dbus.Interface(conn, cs.CONN_IFACE_REQUESTS)
 
-    for f in [complete_search, complete_search2, openfire_search]:
+    for f in [complete_search, complete_search2, openfire_search, double_nick]:
         f(q, bus, conn, requests, stream)
 
 def do_one_search(q, bus, conn, requests, stream, fields, expected_search_keys,
@@ -235,5 +235,21 @@ def openfire_search(q, bus, conn, requests, stream):
 
         assert len(i) == 3
 
+# Server supports 'nickname' and 'nick' which are both mapped to the
+# "nickname" in Telepathy
+def double_nick(q, bus, conn, requests, stream):
+    fields = [('nickname', 'text-single', 'NickName', []),
+        ('nick', 'text-single', 'Nick', []),]
+
+    # ensure that 'nickname' is not added twice
+    expected_search_keys = ['nickname']
+
+    terms = { 'nickname': 'Badger' }
+
+    results = { }
+
+    search_fields, chan, c_search, c_props = do_one_search (q, bus, conn, requests, stream,
+        fields, expected_search_keys, terms, results.values())
+
 if __name__ == '__main__':
     exec_test(test)
-- 
1.5.6.5




More information about the telepathy-commits mailing list