summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-12-27 18:03:08 -0500
committerLance Stout <lancestout@gmail.com>2011-12-27 18:03:08 -0500
commit522f0dac167717603f2b52c0e0c10389d9e41768 (patch)
treefa1f9f480be0b750221949b219f3a752e2673ebe /tests
parent42a86fe0d407521ba23b21ba5d95fa2779186ddb (diff)
parentcd5ae944ec9756fb2f85fbb9a41261b7793b15ac (diff)
downloadslixmpp-522f0dac167717603f2b52c0e0c10389d9e41768.tar.gz
slixmpp-522f0dac167717603f2b52c0e0c10389d9e41768.tar.bz2
slixmpp-522f0dac167717603f2b52c0e0c10389d9e41768.tar.xz
slixmpp-522f0dac167717603f2b52c0e0c10389d9e41768.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'tests')
-rw-r--r--tests/test_stanza_xep_0009.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/test_stanza_xep_0009.py b/tests/test_stanza_xep_0009.py
index 90cc879f..36800335 100644
--- a/tests/test_stanza_xep_0009.py
+++ b/tests/test_stanza_xep_0009.py
@@ -67,7 +67,7 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Nil to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
self.assertEqual(params, xml2py(expected_xml),
@@ -90,7 +90,7 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Boolean to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
self.assertEqual(params, xml2py(expected_xml),
@@ -108,7 +108,7 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ 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),
@@ -145,7 +145,7 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Integer to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
self.assertEqual(params, xml2py(expected_xml),
@@ -166,14 +166,14 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Double to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
self.assertEqual(params, xml2py(expected_xml),
"XML to double conversion")
def testConvertBase64(self):
- params = [rpcbase64(base64.encodestring("Hello, world!"))]
+ params = [rpcbase64(base64.b64encode(b"Hello, world!"))]
params_xml = py2xml(*params)
expected_xml = self.parse_xml("""
<params xmlns="jabber:iq:rpc">
@@ -193,14 +193,14 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Base64 to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
- self.assertEqual(map(lambda x: x.decode(), params),
- map(lambda x: x.decode(), xml2py(expected_xml)),
+ self.assertEqual(list(map(lambda x: x.decode(), params)),
+ list(map(lambda x: x.decode(), xml2py(expected_xml))),
"XML to base64 conversion")
- self.assertEqual(map(lambda x: x.decode(), params),
- map(lambda x: x.decode(), xml2py(alternate_xml)),
+ self.assertEqual(list(map(lambda x: x.decode(), params)),
+ list(map(lambda x: x.decode(), xml2py(alternate_xml))),
"Alternate XML to base64 conversion")
def testConvertDateTime(self):
@@ -215,11 +215,11 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"DateTime to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
- self.assertEqual(map(lambda x: x.iso8601(), params),
- map(lambda x: x.iso8601(), xml2py(expected_xml)),
+ self.assertEqual(list(map(lambda x: x.iso8601(), params)),
+ list(map(lambda x: x.iso8601(), xml2py(expected_xml))),
None)
def testConvertArray(self):
@@ -251,10 +251,10 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Array to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
- self.assertEqual(map(list, params), xml2py(expected_xml),
+ self.assertEqual(list(map(list, params)), xml2py(expected_xml),
"XML to array conversion")
def testConvertStruct(self):
@@ -278,7 +278,7 @@ class TestJabberRPC(SleekTest):
</param>
</params>
""")
- self.failUnless(self.compare(expected_xml, params_xml),
+ self.assertTrue(self.compare(expected_xml, params_xml),
"Struct to XML conversion\nExpected: %s\nGot: %s" % (
tostring(expected_xml), tostring(params_xml)))
self.assertEqual(params, xml2py(expected_xml),