summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-02 12:40:56 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2013-10-04 11:11:43 -0400
commitd5236362733dbb7584c26941a2cd6d1d5c3e02c5 (patch)
tree7cf6b8f14f76e103ff8dfcd5fbab3eac78b91ec4
parent41d8fd6ae9040efebc21750f3849a5a34fdeab96 (diff)
test-self-alias: use new Text API
https://bugs.freedesktop.org/show_bug.cgi?id=69964
-rw-r--r--tests/twisted/test-self-alias.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/twisted/test-self-alias.py b/tests/twisted/test-self-alias.py
index 2a39c0c..7ebff55 100644
--- a/tests/twisted/test-self-alias.py
+++ b/tests/twisted/test-self-alias.py
@@ -38,7 +38,15 @@ def test(q, bus, conn, sip_proxy):
text_iface = dbus.Interface(bus.get_object(conn.bus_name, path),
cs.CHANNEL_TYPE_TEXT)
- text_iface.Send(0, 'Check the display name in From')
+
+ def send_msg(text_iface, txt):
+ msg = [ {'message-type': cs.MT_NORMAL },
+ {'content-type': 'text/plain',
+ 'content': txt }]
+
+ text_iface.SendMessage(msg, 0)
+
+ send_msg(text_iface, 'Check the display name in From')
event = q.expect('sip-message')
@@ -49,14 +57,14 @@ def test(q, bus, conn, sip_proxy):
# Test setting of the default alias
conn.Aliasing.SetAliases({self_handle: default_alias})
- text_iface.Send(0, 'The display name should be missing in From')
+ send_msg(text_iface, 'The display name should be missing in From')
event = q.expect('sip-message')
from_header = event.sip_message.headers['from'][0]
assert from_header.startswith('<' + self_uri + '>'), from_header
# Test if escaping and whitespace normalization works
conn.Aliasing.SetAliases({self_handle: 'foo " bar \\\r\n baz\t'})
- text_iface.Send(0, 'Check display name escaping in From')
+ send_msg(text_iface, 'Check display name escaping in From')
event = q.expect('sip-message')
from_header = event.sip_message.headers['from'][0]
assert from_header.startswith(r'"foo \" bar \\ baz " <' + self_uri + '>'), from_header