[telepathy-gabble/telepathy-gabble-0.8] tests: use ns.VCARD_TEMP_UPDATE instead of hard coding 'vcard-temp:x:update'
Alban Crequy
alban.crequy at collabora.co.uk
Thu Oct 1 04:45:48 PDT 2009
---
tests/twisted/gabbletest.py | 2 +-
tests/twisted/ns.py | 1 +
.../vcard/test-avatar-multiple-resources.py | 3 ++-
tests/twisted/vcard/test-avatar-tokens.py | 2 +-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 13fa8ff..13a9989 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -506,7 +506,7 @@ def make_presence(_from, to='test at localhost', type=None, show=None,
# <x xmlns="vcard-temp:x:update"><photo>4a1...</photo></x>
if photo is not None:
- x = presence.addElement(('vcard-temp:x:update', 'x'))
+ x = presence.addElement((ns.VCARD_TEMP_UPDATE, 'x'))
if photo != "":
x.addElement('photo').addContent(photo)
diff --git a/tests/twisted/ns.py b/tests/twisted/ns.py
index 8982d28..6d80036 100644
--- a/tests/twisted/ns.py
+++ b/tests/twisted/ns.py
@@ -52,6 +52,7 @@ STANZA = "urn:ietf:params:xml:ns:xmpp-stanzas"
STREAMS = "urn:ietf:params:xml:ns:xmpp-streams"
TUBES = 'http://telepathy.freedesktop.org/xmpp/tubes'
VCARD_TEMP = 'vcard-temp'
+VCARD_TEMP_UPDATE = 'vcard-temp:x:update'
X_DATA = 'jabber:x:data'
XML = 'http://www.w3.org/XML/1998/namespace'
X_OOB = 'jabber:x:oob'
diff --git a/tests/twisted/vcard/test-avatar-multiple-resources.py b/tests/twisted/vcard/test-avatar-multiple-resources.py
index d39095b..fb3a779 100644
--- a/tests/twisted/vcard/test-avatar-multiple-resources.py
+++ b/tests/twisted/vcard/test-avatar-multiple-resources.py
@@ -10,11 +10,12 @@ from twisted.words.xish import domish
from servicetest import call_async, EventPattern, sync_dbus
from gabbletest import exec_test, acknowledge_iq, make_result_iq, sync_stream
import constants as cs
+import ns
def make_presence(jid, sha1sum):
p = domish.Element((None, 'presence'))
p['from'] = jid
- x = p.addElement(('vcard-temp:x:update', 'x'))
+ x = p.addElement((ns.VCARD_TEMP_UPDATE, 'x'))
x.addElement('photo', content=sha1sum)
return p
diff --git a/tests/twisted/vcard/test-avatar-tokens.py b/tests/twisted/vcard/test-avatar-tokens.py
index fc18901..f09c1fd 100644
--- a/tests/twisted/vcard/test-avatar-tokens.py
+++ b/tests/twisted/vcard/test-avatar-tokens.py
@@ -14,7 +14,7 @@ def make_presence(jid, sha1sum):
p = domish.Element((None, 'presence'))
p['from'] = jid
p['to'] = 'test at localhost/Resource'
- x = p.addElement(('vcard-temp:x:update', 'x'))
+ x = p.addElement((ns.VCARD_TEMP_UPDATE, 'x'))
x.addElement('photo', content=sha1sum)
return p
--
1.5.6.5
More information about the telepathy-commits
mailing list