[Telepathy-commits] [telepathy-gabble/master] presence/presence.py: Remove unnecessary assertions copied from test-roster

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Aug 4 12:47:24 PDT 2008


20080804194724-53eee-496a97f2ce71e25d4fb93dd97e930977e3e69daf.gz
---
 tests/twisted/presence/presence.py |   61 ++----------------------------------
 1 files changed, 3 insertions(+), 58 deletions(-)

diff --git a/tests/twisted/presence/presence.py b/tests/twisted/presence/presence.py
index 3f8da22..96f945b 100644
--- a/tests/twisted/presence/presence.py
+++ b/tests/twisted/presence/presence.py
@@ -1,6 +1,7 @@
-
 """
-Test basic roster functionality.
+A simple smoke-test for C.I.SimplePresence
+
+FIXME: test C.I.Presence too
 """
 
 import dbus
@@ -9,55 +10,6 @@ from twisted.words.xish import domish, xpath
 
 from gabbletest import exec_test
 
-def _expect_contact_list_channel(q, bus, conn, name, contacts):
-    event = q.expect('dbus-signal', signal='NewChannel')
-    path, type, handle_type, handle, suppress_handler = event.args
-
-    assert type == u'org.freedesktop.Telepathy.Channel.Type.ContactList'
-    assert conn.InspectHandles(handle_type, [handle])[0] == name
-    chan = bus.get_object(conn.bus_name, path)
-    group_iface = dbus.Interface(chan,
-        u'org.freedesktop.Telepathy.Channel.Interface.Group')
-    members = group_iface.GetMembers()
-    assert conn.InspectHandles(1, members) == contacts
-
-    # Exercise basic Channel Properties from spec 0.17.7
-    channel_props = chan.GetAll(
-            'org.freedesktop.Telepathy.Channel',
-            dbus_interface='org.freedesktop.DBus.Properties')
-    assert channel_props.get('TargetHandle') == handle,\
-            (channel_props.get('TargetHandle'), handle)
-    assert channel_props.get('TargetHandleType') == 3,\
-            channel_props.get('TargetHandleType')
-    assert channel_props.get('ChannelType') == \
-            'org.freedesktop.Telepathy.Channel.Type.ContactList',\
-            channel_props.get('ChannelType')
-    assert 'org.freedesktop.Telepathy.Channel.Interface.Group' in \
-            channel_props.get('Interfaces', ()), \
-            channel_props.get('Interfaces')
-
-    # Exercise FUTURE properties
-    future_props = chan.GetAll(
-            'org.freedesktop.Telepathy.Channel.FUTURE',
-            dbus_interface='org.freedesktop.DBus.Properties')
-    assert future_props['Requested'] == False
-    assert future_props['TargetID'] == name
-    assert future_props['InitiatorID'] == ''
-    assert future_props['InitiatorHandle'] == 0
-
-    # Exercise Group Properties from spec 0.17.6 (in a basic way)
-    group_props = chan.GetAll(
-            'org.freedesktop.Telepathy.Channel.Interface.Group',
-            dbus_interface='org.freedesktop.DBus.Properties')
-    assert 'HandleOwners' in group_props, group_props
-    assert 'Members' in group_props, group_props
-    assert group_props['Members'] == members, group_props['Members']
-    assert 'LocalPendingMembers' in group_props, group_props
-    assert group_props['LocalPendingMembers'] == []
-    assert 'RemotePendingMembers' in group_props, group_props
-    assert group_props['RemotePendingMembers'] == []
-    assert 'GroupFlags' in group_props, group_props
-
 def test(q, bus, conn, stream):
     conn.Connect()
     q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
@@ -73,13 +25,6 @@ def test(q, bus, conn, stream):
 
     stream.send(event.stanza)
 
-    _expect_contact_list_channel(q, bus, conn, 'publish',
-        ['amy at foo.com'])
-    _expect_contact_list_channel(q, bus, conn, 'subscribe',
-        ['amy at foo.com'])
-    _expect_contact_list_channel(q, bus, conn, 'known',
-        ['amy at foo.com'])
-
     presence = domish.Element((None, 'presence'))
     presence['from'] = 'amy at foo.com'
     show = presence.addElement((None, 'show'))
-- 
1.5.6.3




More information about the Telepathy-commits mailing list