diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-10-09 12:34:30 -0400 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-10-11 17:55:05 -0400 |
commit | c3bbf07be5c6a4e65b6acd9c690d25ced61c166f (patch) | |
tree | 501b8267e54a826b8fb656dcb164fbe2fc677ae1 | |
parent | a16c14451be911617f5d82e2d23c6f9fb03c2870 (diff) |
servicetest: add more ifaces on wrappers
This will make the transition to the new interface name easier.
-rw-r--r-- | tests/twisted/jingle/call_helper.py | 5 | ||||
-rw-r--r-- | tests/twisted/muc/avatars.py | 3 | ||||
-rw-r--r-- | tests/twisted/muc/password.py | 3 | ||||
-rw-r--r-- | tests/twisted/mucutil.py | 2 | ||||
-rw-r--r-- | tests/twisted/servicetest.py | 15 | ||||
-rw-r--r-- | tests/twisted/text/receipts.py | 3 | ||||
-rw-r--r-- | tests/twisted/text/test-chat-state.py | 15 | ||||
-rw-r--r-- | tests/twisted/text/test-text.py | 3 |
8 files changed, 24 insertions, 25 deletions
diff --git a/tests/twisted/jingle/call_helper.py b/tests/twisted/jingle/call_helper.py index b6b1e1add..781750a13 100644 --- a/tests/twisted/jingle/call_helper.py +++ b/tests/twisted/jingle/call_helper.py @@ -130,7 +130,7 @@ class CallTest(object): incoming = self.incoming content = wrap_content(self.bus.get_object(self.conn.bus_name, - content_path), ['DTMF', 'Media']) + content_path)) content_props = content.GetAll(cs.CALL_CONTENT, dbus_interface=dbus.PROPERTIES_IFACE) @@ -316,8 +316,7 @@ class CallTest(object): chan_path = signal.args[0][0][0] self.chan = wrap_channel( - self.bus.get_object(self.conn.bus_name, chan_path), - 'Call', ['Hold']) + self.bus.get_object(self.conn.bus_name, chan_path), 'Call') properties = self.chan.GetAll(cs.CHANNEL_TYPE_CALL, dbus_interface=dbus.PROPERTIES_IFACE) diff --git a/tests/twisted/muc/avatars.py b/tests/twisted/muc/avatars.py index bb3a29268..323b63b24 100644 --- a/tests/twisted/muc/avatars.py +++ b/tests/twisted/muc/avatars.py @@ -100,8 +100,7 @@ def test(q, bus, conn, stream): photo=AVATAR_1_SHA1)) path, _ = q.expect('dbus-return', method='CreateChannel').value - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['Messages']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') members = chan.Properties.Get(cs.CHANNEL_IFACE_GROUP, 'Members') assertLength(3, members) diff --git a/tests/twisted/muc/password.py b/tests/twisted/muc/password.py index 0167bfaa2..ee1ec3300 100644 --- a/tests/twisted/muc/password.py +++ b/tests/twisted/muc/password.py @@ -38,8 +38,7 @@ def test(q, bus, conn, stream): EventPattern('dbus-signal', signal='PasswordFlagsChanged', args=[cs.PASSWORD_FLAG_PROVIDE, 0])) - chan = wrap_channel(bus.get_object(conn.bus_name, cc.value[0]), 'Text', - ['Password']) + chan = wrap_channel(bus.get_object(conn.bus_name, cc.value[0]), 'Text') flags = chan.Password.GetPasswordFlags() assertEquals(cs.PASSWORD_FLAG_PROVIDE, flags) diff --git a/tests/twisted/mucutil.py b/tests/twisted/mucutil.py index 96f3dfc0d..8bb830b9e 100644 --- a/tests/twisted/mucutil.py +++ b/tests/twisted/mucutil.py @@ -73,7 +73,7 @@ def join_muc(q, bus, conn, stream, muc, request=None, *also_capture) path, props = captured[0].value chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['Messages', 'Subject.DRAFT', 'RoomConfig1', 'ChatState']) + ['Subject.DRAFT']) return (chan, path, props) + tuple(captured[1:]) diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py index 0beedb4d0..1fe8b2cb7 100644 --- a/tests/twisted/servicetest.py +++ b/tests/twisted/servicetest.py @@ -646,8 +646,14 @@ def wrap_connection(conn): def wrap_channel(chan, type_, extra=None): interfaces = { type_: tp_name_prefix + '.Channel.Type.' + type_, - 'Channel': tp_name_prefix + '.Channel', - 'Group': tp_name_prefix + '.Channel.Interface.Group', + 'Channel': cs.CHANNEL, + 'Group': cs.CHANNEL_IFACE_GROUP, + 'Hold': cs.CHANNEL_IFACE_HOLD, + 'Messages': cs.CHANNEL_IFACE_MESSAGES, + 'RoomConfig1': cs.CHANNEL_IFACE_ROOM_CONFIG, + 'ChatState': cs.CHANNEL_IFACE_CHAT_STATE, + 'Destroyable': cs.CHANNEL_IFACE_DESTROYABLE, + 'Password': cs.CHANNEL_IFACE_PASSWORD, } if extra: @@ -659,7 +665,10 @@ def wrap_channel(chan, type_, extra=None): def wrap_content(chan, extra=None): - interfaces = { } + interfaces = { + 'DTMF': cs.CALL_CONTENT_IFACE_DTMF, + 'Media': cs.CALL_CONTENT_IFACE_MEDIA, + } if extra: interfaces.update(dict([ diff --git a/tests/twisted/text/receipts.py b/tests/twisted/text/receipts.py index 45c7d9f89..2c11af2e3 100644 --- a/tests/twisted/text/receipts.py +++ b/tests/twisted/text/receipts.py @@ -172,8 +172,7 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_ID: GUYBRUSH, })[0] - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['Messages']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') # Let's start out with an empty roster, eh? e = q.expect('stream-iq', iq_type='get', query_ns=ns.ROSTER) diff --git a/tests/twisted/text/test-chat-state.py b/tests/twisted/text/test-chat-state.py index 6502fe34b..64bd44f53 100644 --- a/tests/twisted/text/test-chat-state.py +++ b/tests/twisted/text/test-chat-state.py @@ -48,8 +48,7 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_HANDLE: foo_handle, })[0] - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['ChatState', 'Destroyable']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') presence = make_presence(full_jid, status='hello', caps={ @@ -192,8 +191,7 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_HANDLE: foo_handle, })[0] - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['ChatState', 'Destroyable']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') # Close it immediately; the peer should again not get a <gone/> # notification, since we haven't sent any notifications on that channel. @@ -216,8 +214,7 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_ID: jid, })[0] - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['ChatState']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') stream.send(make_message(full_jid, body='i am invisible', state='active')) @@ -251,8 +248,7 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_ID: jid, })[0] - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['ChatState']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') # We shouldn't send any notifications until we actually send a message. # But ChatStateChanged is still emitted locally @@ -342,8 +338,7 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_ID: jid, })[0] - chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text', - ['ChatState']) + chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') # We shouldn't send any notifications until we actually send a message. e = EventPattern('stream-message', to=jid) diff --git a/tests/twisted/text/test-text.py b/tests/twisted/text/test-text.py index 380d9a657..c0b734cf0 100644 --- a/tests/twisted/text/test-text.py +++ b/tests/twisted/text/test-text.py @@ -25,8 +25,7 @@ def test(q, bus, conn, stream): event = q.expect('dbus-signal', signal='NewChannels') path, props = event.args[0][0] - text_chan = wrap_channel( - bus.get_object(conn.bus_name, path), 'Text', ['Messages']) + text_chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text') assertEquals(cs.CHANNEL_TYPE_TEXT, props[cs.CHANNEL_TYPE]) assertEquals(cs.HT_CONTACT, props[cs.TARGET_HANDLE_TYPE]) foo_at_bar_dot_com_handle = props[cs.TARGET_HANDLE] |