[Telepathy-commits] [telepathy-salut/master] test-request-im.py: use wait_for_contact_list
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Mon Dec 22 04:40:14 PST 2008
---
tests/twisted/avahi/test-request-im.py | 24 ++----------------------
1 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/tests/twisted/avahi/test-request-im.py b/tests/twisted/avahi/test-request-im.py
index 90e018a..c4264e6 100644
--- a/tests/twisted/avahi/test-request-im.py
+++ b/tests/twisted/avahi/test-request-im.py
@@ -5,13 +5,12 @@ Test requesting of text 1-1 channels using the old and new request API.
import dbus
-from saluttest import exec_test
+from saluttest import exec_test, wait_for_contact_list
from servicetest import call_async, EventPattern, \
tp_name_prefix, make_channel_proxy
from avahitest import get_host_name, AvahiAnnouncer
from xmppstream import setup_stream_listener
-CONNECTION_INTERFACE_REQUESTS = 'org.freedesktop.Telepathy.Connection.Interface.Requests'
CHANNEL_TYPE_TEXT = 'org.freedesktop.Telepathy.Channel.Type.Text'
CHANNEL_TYPE_CONTACT_LIST = 'org.freedesktop.Telepathy.Channel.Type.ContactList'
@@ -28,28 +27,9 @@ def test(q, bus, conn):
contact_name = "test-request-im@" + get_host_name()
listener, port = setup_stream_listener(q, contact_name)
- requestotron = dbus.Interface(conn, CONNECTION_INTERFACE_REQUESTS)
-
# FIXME: this is a hack to be sure to have all the contact list channels
# announced so they won't interfere with the muc ones announces.
- # publish
- requestotron.CreateChannel({
- 'org.freedesktop.Telepathy.Channel.ChannelType': CHANNEL_TYPE_CONTACT_LIST,
- 'org.freedesktop.Telepathy.Channel.TargetHandleType': HT_CONTACT_LIST,
- 'org.freedesktop.Telepathy.Channel.TargetID': 'publish'})
- q.expect('dbus-signal', signal='NewChannel')
- # subscribe
- requestotron.CreateChannel({
- 'org.freedesktop.Telepathy.Channel.ChannelType': CHANNEL_TYPE_CONTACT_LIST,
- 'org.freedesktop.Telepathy.Channel.TargetHandleType': HT_CONTACT_LIST,
- 'org.freedesktop.Telepathy.Channel.TargetID': 'subscribe'})
- q.expect('dbus-signal', signal='NewChannel')
- # known
- requestotron.CreateChannel({
- 'org.freedesktop.Telepathy.Channel.ChannelType': CHANNEL_TYPE_CONTACT_LIST,
- 'org.freedesktop.Telepathy.Channel.TargetHandleType': HT_CONTACT_LIST,
- 'org.freedesktop.Telepathy.Channel.TargetID': 'known'})
- q.expect('dbus-signal', signal='NewChannel')
+ wait_for_contact_list(q, conn)
AvahiAnnouncer(contact_name, "_presence._tcp", port, basic_txt)
--
1.5.6.5
More information about the Telepathy-commits
mailing list