Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-08-26 16:48:34 +0300
committerlovetox <philipp@hoerist.com>2020-08-26 23:20:34 +0300
commit3199c2f01a7bfcd133c802ba8245237481da940f (patch)
treefd6ba3f5ed6ba192bbd85c000e61319baafa326d /test
parent723e50076769aea66376448cad472af5eea4e37b (diff)
Use new JID attributes/methods
Diffstat (limited to 'test')
-rw-r--r--test/lib/util.py2
-rw-r--r--test/unit/test_bookmarks.py6
-rw-r--r--test/unit/test_error_parsing.py3
-rw-r--r--test/unit/test_jid_parsing.py8
4 files changed, 10 insertions, 9 deletions
diff --git a/test/lib/util.py b/test/lib/util.py
index 1fbe634..2bb3b26 100644
--- a/test/lib/util.py
+++ b/test/lib/util.py
@@ -14,7 +14,7 @@ class StanzaHandlerTest(unittest.TestCase):
self.client.is_websocket = False
self.dispatcher = StanzaDispatcher(self.client)
- self.client.get_bound_jid.return_value = JID('test@test.test')
+ self.client.get_bound_jid.return_value = JID.from_string('test@test.test')
self.dispatcher.reset_parser()
self.dispatcher.process_data(STREAM_START)
diff --git a/test/unit/test_bookmarks.py b/test/unit/test_bookmarks.py
index b9f423e..53a6592 100644
--- a/test/unit/test_bookmarks.py
+++ b/test/unit/test_bookmarks.py
@@ -13,12 +13,12 @@ class BookmarkTest(StanzaHandlerTest):
def _on_message(_con, _stanza, properties):
data = [
- BookmarkData(jid=JID('theplay@conference.shakespeare.lit'),
+ BookmarkData(jid=JID.from_string('theplay@conference.shakespeare.lit'),
name='The Play\'s the Thing',
autojoin=True,
password='pass',
nick='JC'),
- BookmarkData(jid=JID('second@conference.shakespeare.lit'),
+ BookmarkData(jid=JID.from_string('second@conference.shakespeare.lit'),
name='Second room',
autojoin=False,
password=None,
@@ -71,7 +71,7 @@ class BookmarkTest(StanzaHandlerTest):
def test_bookmark_2_parsing(self):
def _on_message(_con, _stanza, properties):
- data = BookmarkData(jid=JID('theplay@conference.shakespeare.lit'),
+ data = BookmarkData(jid=JID.from_string('theplay@conference.shakespeare.lit'),
name='The Play\'s the Thing',
autojoin=True,
password=None,
diff --git a/test/unit/test_error_parsing.py b/test/unit/test_error_parsing.py
index 213bc25..753adda 100644
--- a/test/unit/test_error_parsing.py
+++ b/test/unit/test_error_parsing.py
@@ -1,6 +1,7 @@
import unittest
from nbxmpp.protocol import Iq
+from nbxmpp.protocol import JID
from nbxmpp.util import error_factory
@@ -29,4 +30,4 @@ class TestErrorParsing(unittest.TestCase):
self.assertEqual(error.get_text('de'), 'File zu groß. Erlaubt sind 20000 bytes')
self.assertEqual(error.type, 'modify')
self.assertEqual(error.id, 'step_03')
- self.assertEqual(error.jid, 'upload.montague.tld')
+ self.assertEqual(error.jid, JID.from_string('upload.montague.tld'))
diff --git a/test/unit/test_jid_parsing.py b/test/unit/test_jid_parsing.py
index ca10d9b..d1d9d00 100644
--- a/test/unit/test_jid_parsing.py
+++ b/test/unit/test_jid_parsing.py
@@ -30,7 +30,7 @@ class JIDParsing(unittest.TestCase):
]
for jid in tests:
- JID(jid)
+ JID.from_string(jid)
def test_invalid_jids(self):
tests = [
@@ -48,7 +48,7 @@ class JIDParsing(unittest.TestCase):
for jid, exception in tests:
with self.assertRaises(exception):
- JID(jid)
+ JID.from_string(jid)
def test_ip_literals(self):
tests = [
@@ -57,7 +57,7 @@ class JIDParsing(unittest.TestCase):
]
for jid in tests:
- JID(jid)
+ JID.from_string(jid)
def test_jid_equality(self):
tests = [
@@ -67,4 +67,4 @@ class JIDParsing(unittest.TestCase):
]
for jid in tests:
- self.assertTrue(JID(jid) == jid)
+ self.assertTrue(JID.from_string(jid) == JID.from_string(jid))