summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCorrel Roush <correl@gmail.com>2012-02-17 12:24:44 -0500
committerCorrel Roush <correl@gmail.com>2012-02-17 12:24:44 -0500
commit31d3e3b2b640e210e577eaa01c292c92be84d953 (patch)
tree37b3e9621e936abc534e158cdcd2a1ef3464db32 /tests
parent79f1aa0e1ba7dd29bf597beeae924b96950f9416 (diff)
downloadslixmpp-31d3e3b2b640e210e577eaa01c292c92be84d953.tar.gz
slixmpp-31d3e3b2b640e210e577eaa01c292c92be84d953.tar.bz2
slixmpp-31d3e3b2b640e210e577eaa01c292c92be84d953.tar.xz
slixmpp-31d3e3b2b640e210e577eaa01c292c92be84d953.zip
Updated XEP-0009 to handle unicode strings
Diffstat (limited to 'tests')
-rw-r--r--tests/test_stanza_xep_0009.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_stanza_xep_0009.py b/tests/test_stanza_xep_0009.py
index 36800335..724ebb95 100644
--- a/tests/test_stanza_xep_0009.py
+++ b/tests/test_stanza_xep_0009.py
@@ -1,3 +1,5 @@
+# -*- encoding:utf-8 -*-
+
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz, Dann Martens (TOMOTON).
@@ -114,6 +116,24 @@ class TestJabberRPC(SleekTest):
self.assertEqual(params, xml2py(expected_xml),
"XML to string conversion")
+ def testConvertUnicodeString(self):
+ params = [u"おはよう"]
+ params_xml = py2xml(*params)
+ expected_xml = self.parse_xml("""
+ <params xmlns="jabber:iq:rpc">
+ <param>
+ <value>
+ <string>おはよう</string>
+ </value>
+ </param>
+ </params>
+ """)
+ self.assertTrue(self.compare(expected_xml, params_xml),
+ "String to XML conversion\nExpected: %s\nGot: %s" % (
+ tostring(expected_xml), tostring(params_xml)))
+ self.assertEqual(params, xml2py(expected_xml),
+ "XML to string conversion")
+
def testConvertInteger(self):
params = [32767, -32768]
params_xml = py2xml(*params)