[telepathy-gabble/master] Test hiding Google roster contacts with sub="none"
Will Thompson
will.thompson at collabora.co.uk
Fri Jul 17 08:08:55 PDT 2009
---
tests/twisted/roster/test-google-roster.py | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/tests/twisted/roster/test-google-roster.py b/tests/twisted/roster/test-google-roster.py
index a22a367..f098267 100644
--- a/tests/twisted/roster/test-google-roster.py
+++ b/tests/twisted/roster/test-google-roster.py
@@ -59,6 +59,14 @@ def test(q, bus, conn, stream):
# Gabble suppresses contacts labelled as "hidden" from all roster channels.
add_roster_item(query, 'should-be-hidden at example.com', 'both', False,
{'gr:t': 'H'})
+ # Gabble should hide contacts on the Google roster with subscription="none"
+ # and ask!="subscribe", to hide contacts which are actually just email
+ # addresses. (This is in line with Pidgin; the code there was added by Sean
+ # Egan, who worked on Google Talk for Google at the time.)
+ add_roster_item(query, 'probably-an-email-address at badger.com', 'none',
+ False)
+ # This contact is remote pending, so we shouldn't suppress it.
+ add_roster_item(query, 'this-is-a-jid at badger.com', 'none', True)
add_roster_item(query, 'lp-bug-298293 at gmail.com', 'both', False,
{'gr:autosub': 'true'})
@@ -72,11 +80,13 @@ def test(q, bus, conn, stream):
# where Gabble was incorrectly hiding valid contacts.
expected_contacts = ['lp-bug-298293 at gmail.com']
+ rp_contacts = ['this-is-a-jid at badger.com']
publish = expect_list_channel(q, bus, conn, 'publish', expected_contacts)
subscribe = expect_list_channel(q, bus, conn, 'subscribe',
- expected_contacts)
- stored = expect_list_channel(q, bus, conn, 'stored', expected_contacts)
+ expected_contacts, rp_contacts=rp_contacts)
+ stored = expect_list_channel(q, bus, conn, 'stored',
+ expected_contacts+rp_contacts)
contact = 'bob at foo.com'
handle = conn.RequestHandles(cs.HT_CONTACT, ['bob at foo.com'])[0]
@@ -97,10 +107,7 @@ def test(q, bus, conn, stream):
# We don't expect the stored list to be updated here, because Gabble
# ignores Google Talk roster items with subscription="none" and
- # ask!="subscribe", to hide contacts which are actually just email
- # addresses. (This is in line with Pidgin; the code there was added by Sean
- # Egan, who worked on Google Talk for Google at the time.)
-
+ # ask!="subscribe" as described above.
event = q.expect('stream-presence', presence_type='subscribe')
# Google's server appears to be buggy. If you send
--
1.5.6.5
More information about the telepathy-commits
mailing list