summaryrefslogtreecommitdiff
path: root/sleekxmpp/test
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-05-20 16:48:13 -0400
committerLance Stout <lancestout@gmail.com>2011-05-20 16:48:13 -0400
commit6b274a2543744f9b94823f5bd2a6c23ec8cc3f75 (patch)
tree6272aac508277e9ce0f14c8c15912719d616a575 /sleekxmpp/test
parent6a07e7cbe3e995f44ca3ba75a0ff83616269cf5a (diff)
downloadslixmpp-6b274a2543744f9b94823f5bd2a6c23ec8cc3f75.tar.gz
slixmpp-6b274a2543744f9b94823f5bd2a6c23ec8cc3f75.tar.bz2
slixmpp-6b274a2543744f9b94823f5bd2a6c23ec8cc3f75.tar.xz
slixmpp-6b274a2543744f9b94823f5bd2a6c23ec8cc3f75.zip
Fix double roster entry issue with Unicode.
JIDs with Unicode values were being encoded by the JID class instead of leaving them as just Unicode strings. It may still be a good idea to use from __future__ import unicode_literals pretty much everywhere though. Fixes issue #88.
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r--sleekxmpp/test/sleektest.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index fd47a87e..24af1e7a 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -16,7 +16,8 @@ import sleekxmpp
from sleekxmpp import ClientXMPP, ComponentXMPP
from sleekxmpp.stanza import Message, Iq, Presence
from sleekxmpp.test import TestSocket, TestLiveSocket
-from sleekxmpp.xmlstream import StanzaBase, ET, register_stanza_plugin
+from sleekxmpp.xmlstream import ET, register_stanza_plugin
+from sleekxmpp.xmlstream import ElementBase, StanzaBase
from sleekxmpp.xmlstream.tostring import tostring
from sleekxmpp.xmlstream.matcher import StanzaPath, MatcherId
from sleekxmpp.xmlstream.matcher import MatchXMLMask, MatchXPath
@@ -201,7 +202,7 @@ class SleekTest(unittest.TestCase):
"Stanza:\n%s" % str(stanza))
else:
stanza_class = stanza.__class__
- if isinstance(criteria, str):
+ if not isinstance(criteria, ElementBase):
xml = self.parse_xml(criteria)
else:
xml = criteria.xml
@@ -606,7 +607,7 @@ class SleekTest(unittest.TestCase):
self.fail("Stanza data was sent: %s" % sent)
if sent is None:
self.fail("No stanza was sent.")
-
+
xml = self.parse_xml(sent)
self.fix_namespaces(xml, 'jabber:client')
sent = self.xmpp._build_stanza(xml, 'jabber:client')