diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-10-02 11:59:07 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-10-02 11:59:07 +0200 |
commit | d6342967598ae7fa822592b42e0f85de2beaf916 (patch) | |
tree | b8e7ebaca3d25944fc2028d3bde5e16374914401 | |
parent | d5cfb524cb959a4928d8c267c3b29295f325a954 (diff) |
test-self-alias.py: use constants
-rw-r--r-- | tests/twisted/test-self-alias.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/twisted/test-self-alias.py b/tests/twisted/test-self-alias.py index 6c2e0a8..8e6e585 100644 --- a/tests/twisted/test-self-alias.py +++ b/tests/twisted/test-self-alias.py @@ -3,14 +3,10 @@ # from sofiatest import exec_test -from servicetest import tp_name_prefix +import constants as cs import dbus -TEXT_TYPE = tp_name_prefix + '.Channel.Type.Text' -ALIASING_INTERFACE = tp_name_prefix + '.Connection.Interface.Aliasing' -CONTACTS_INTERFACE = tp_name_prefix + '.Connection.Interface.Contacts' - def test(q, bus, conn, sip_proxy): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', args=[0, 1]) @@ -26,19 +22,19 @@ def test(q, bus, conn, sip_proxy): handle = conn.RequestHandles(1, ['sip:user@somewhere.com'])[0] - assert ALIASING_INTERFACE in \ - conn.Properties.Get(CONTACTS_INTERFACE, "ContactAttributeInterfaces") + assert cs.CONN_IFACE_ALIASING in \ + conn.Properties.Get(cs.CONN_IFACE_CONTACTS, "ContactAttributeInterfaces") attrs = conn.Contacts.GetContactAttributes([self_handle, handle], - [ALIASING_INTERFACE], False) - assert ALIASING_INTERFACE + "/alias" in attrs[self_handle] - assert attrs[self_handle][ALIASING_INTERFACE + "/alias"] == u'foo@bar.baz' + [cs.CONN_IFACE_ALIASING], False) + assert cs.CONN_IFACE_ALIASING + "/alias" in attrs[self_handle] + assert attrs[self_handle][cs.CONN_IFACE_ALIASING + "/alias"] == u'foo@bar.baz' - conn.RequestChannel(TEXT_TYPE, 1, handle, True) + conn.RequestChannel(cs.CHANNEL_TYPE_TEXT, 1, handle, True) event = q.expect('dbus-signal', signal='NewChannel') text_iface = dbus.Interface(bus.get_object(conn.bus_name, event.args[0]), - TEXT_TYPE) + cs.CHANNEL_TYPE_TEXT) text_iface.Send(0, 'Check the display name in From') event = q.expect('sip-message') |