telepathy-rakia: test-self-alias.py: use constants

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Wed Oct 2 03:43:32 PDT 2013


Module: telepathy-rakia
Branch: master
Commit: d6342967598ae7fa822592b42e0f85de2beaf916
URL:    http://cgit.freedesktop.org/telepathy/telepathy-rakia/commit/?id=d6342967598ae7fa822592b42e0f85de2beaf916

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Wed Oct  2 11:59:07 2013 +0200

test-self-alias.py: use constants

---

 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 at 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 at 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 at 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')



More information about the telepathy-commits mailing list