summaryrefslogtreecommitdiff
path: root/sleekxmpp/test
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-05 16:54:26 -0700
committerLance Stout <lancestout@gmail.com>2012-06-18 22:00:33 -0700
commit181aea737d5bce9479795b58c29b5a92da3bd48b (patch)
tree75fed30d668542593e12a208bc88775c19d6d6b6 /sleekxmpp/test
parentee702f40710219290508f95ac01df50a96d04f3c (diff)
downloadslixmpp-181aea737d5bce9479795b58c29b5a92da3bd48b.tar.gz
slixmpp-181aea737d5bce9479795b58c29b5a92da3bd48b.tar.bz2
slixmpp-181aea737d5bce9479795b58c29b5a92da3bd48b.tar.xz
slixmpp-181aea737d5bce9479795b58c29b5a92da3bd48b.zip
Add initial support for xml:lang for streams and stanza plugins.
Remaining items are suitable default actions for language supporting interfaces.
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r--sleekxmpp/test/sleektest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index ba79dce8..92a7688a 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -333,6 +333,9 @@ class SleekTest(unittest.TestCase):
# Remove unique ID prefix to make it easier to test
self.xmpp._id_prefix = ''
self.xmpp._disconnect_wait_for_threads = False
+ self.xmpp.default_lang = None
+ self.xmpp.peer_default_lang = None
+
# We will use this to wait for the session_start event
# for live connections.
@@ -386,6 +389,7 @@ class SleekTest(unittest.TestCase):
sid='',
stream_ns="http://etherx.jabber.org/streams",
default_ns="jabber:client",
+ default_lang="en",
version="1.0",
xml_header=True):
"""
@@ -413,6 +417,8 @@ class SleekTest(unittest.TestCase):
parts.append('from="%s"' % sfrom)
if sid:
parts.append('id="%s"' % sid)
+ if default_lang:
+ parts.append('xml:lang="%s"' % default_lang)
parts.append('version="%s"' % version)
parts.append('xmlns:stream="%s"' % stream_ns)
parts.append('xmlns="%s"' % default_ns)
@@ -564,6 +570,7 @@ class SleekTest(unittest.TestCase):
sid='',
stream_ns="http://etherx.jabber.org/streams",
default_ns="jabber:client",
+ default_lang="en",
version="1.0",
xml_header=False,
timeout=1):
@@ -585,6 +592,7 @@ class SleekTest(unittest.TestCase):
header = self.make_header(sto, sfrom, sid,
stream_ns=stream_ns,
default_ns=default_ns,
+ default_lang=default_lang,
version=version,
xml_header=xml_header)
sent_header = self.xmpp.socket.next_sent(timeout)