summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-07-29 02:24:33 -0700
committerLance Stout <lancestout@gmail.com>2013-07-29 02:24:33 -0700
commitd439c4f21515813b69f8e39d430cee8ca9a3c946 (patch)
treee8a4970b42759c9fcebe01a18a56bddaf0d88214
parent85bc6f530178f3b049ea2ae064f168b77aeee332 (diff)
parenta9f2e1482ca65a919a7a9f0c44af7f9f51907887 (diff)
downloadslixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.tar.gz
slixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.tar.bz2
slixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.tar.xz
slixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.zip
Merge pull request #252 from jpcaruana/develop
refactor : optimize imports + replace mutable argument (a list) in StateMachine constructor
-rw-r--r--sleekxmpp/__init__.py1
-rw-r--r--sleekxmpp/basexmpp.py6
-rw-r--r--sleekxmpp/features/feature_bind/bind.py2
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py1
-rw-r--r--sleekxmpp/features/feature_preapproval/preapproval.py2
-rw-r--r--sleekxmpp/features/feature_rosterver/rosterver.py2
-rw-r--r--sleekxmpp/plugins/xep_0082.py1
-rw-r--r--sleekxmpp/roster/__init__.py1
-rw-r--r--sleekxmpp/test/sleektest.py6
-rw-r--r--sleekxmpp/thirdparty/socks.py6
-rw-r--r--sleekxmpp/thirdparty/statemachine.py3
-rw-r--r--sleekxmpp/util/stringprep_profiles.py1
-rw-r--r--tests/test_events.py3
-rw-r--r--tests/test_jid.py3
-rw-r--r--tests/test_stanza_base.py3
-rw-r--r--tests/test_stanza_element.py5
-rw-r--r--tests/test_stanza_error.py3
-rw-r--r--tests/test_stanza_gmail.py5
-rw-r--r--tests/test_stanza_iq.py3
-rw-r--r--tests/test_stanza_message.py4
-rw-r--r--tests/test_stanza_presence.py6
-rw-r--r--tests/test_stanza_roster.py5
-rw-r--r--tests/test_stanza_xep_0004.py5
-rw-r--r--tests/test_stanza_xep_0030.py5
-rw-r--r--tests/test_stanza_xep_0033.py5
-rw-r--r--tests/test_stanza_xep_0047.py6
-rw-r--r--tests/test_stanza_xep_0050.py4
-rw-r--r--tests/test_stanza_xep_0059.py4
-rw-r--r--tests/test_stanza_xep_0060.py4
-rw-r--r--tests/test_stanza_xep_0085.py6
-rw-r--r--tests/test_stanza_xep_0184.py5
-rw-r--r--tests/test_stream.py3
-rw-r--r--tests/test_stream_exceptions.py5
-rw-r--r--tests/test_stream_filters.py7
-rw-r--r--tests/test_stream_handlers.py8
-rw-r--r--tests/test_stream_presence.py3
-rw-r--r--tests/test_stream_roster.py5
-rw-r--r--tests/test_stream_xep_0030.py4
-rw-r--r--tests/test_stream_xep_0047.py3
-rw-r--r--tests/test_stream_xep_0050.py7
-rw-r--r--tests/test_stream_xep_0059.py3
-rw-r--r--tests/test_stream_xep_0060.py5
-rw-r--r--tests/test_stream_xep_0066.py4
-rw-r--r--tests/test_stream_xep_0085.py4
-rw-r--r--tests/test_stream_xep_0092.py3
-rw-r--r--tests/test_stream_xep_0128.py8
-rw-r--r--tests/test_stream_xep_0249.py6
-rw-r--r--tests/test_tostring.py6
48 files changed, 112 insertions, 88 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py
index f0dc2ce2..054a7aa0 100644
--- a/sleekxmpp/__init__.py
+++ b/sleekxmpp/__init__.py
@@ -14,6 +14,5 @@ from sleekxmpp.jid import JID, InvalidJID
from sleekxmpp.xmlstream.handler import *
from sleekxmpp.xmlstream import XMLStream, RestartStream
from sleekxmpp.xmlstream.matcher import *
-from sleekxmpp.xmlstream.stanzabase import StanzaBase, ET
from sleekxmpp.version import __version__, __version_info__
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index a54e4bb6..7b608d13 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -19,14 +19,13 @@ import logging
import threading
import sleekxmpp
-from sleekxmpp import plugins, features, roster
+from sleekxmpp import plugins, roster
from sleekxmpp.api import APIRegistry
from sleekxmpp.exceptions import IqError, IqTimeout
from sleekxmpp.stanza import Message, Presence, Iq, StreamError
from sleekxmpp.stanza.roster import Roster
from sleekxmpp.stanza.nick import Nick
-from sleekxmpp.stanza.htmlim import HTMLIM
from sleekxmpp.xmlstream import XMLStream, JID
from sleekxmpp.xmlstream import ET, register_stanza_plugin
@@ -34,8 +33,7 @@ from sleekxmpp.xmlstream.matcher import MatchXPath
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.stanzabase import XML_NS
-from sleekxmpp.features import *
-from sleekxmpp.plugins import PluginManager, register_plugin, load_plugin
+from sleekxmpp.plugins import PluginManager, load_plugin
log = logging.getLogger(__name__)
diff --git a/sleekxmpp/features/feature_bind/bind.py b/sleekxmpp/features/feature_bind/bind.py
index bc145620..ee4c1e9b 100644
--- a/sleekxmpp/features/feature_bind/bind.py
+++ b/sleekxmpp/features/feature_bind/bind.py
@@ -12,7 +12,7 @@ from sleekxmpp.jid import JID
from sleekxmpp.stanza import Iq, StreamFeatures
from sleekxmpp.features.feature_bind import stanza
from sleekxmpp.xmlstream import register_stanza_plugin
-from sleekxmpp.plugins import BasePlugin, register_plugin
+from sleekxmpp.plugins import BasePlugin
log = logging.getLogger(__name__)
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index 58ed9b91..ca94bce1 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -6,7 +6,6 @@
See the file LICENSE for copying permission.
"""
-import sys
import ssl
import logging
diff --git a/sleekxmpp/features/feature_preapproval/preapproval.py b/sleekxmpp/features/feature_preapproval/preapproval.py
index 3823c472..c7106ed3 100644
--- a/sleekxmpp/features/feature_preapproval/preapproval.py
+++ b/sleekxmpp/features/feature_preapproval/preapproval.py
@@ -8,7 +8,7 @@
import logging
-from sleekxmpp.stanza import Iq, StreamFeatures
+from sleekxmpp.stanza import StreamFeatures
from sleekxmpp.features.feature_preapproval import stanza
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.base import BasePlugin
diff --git a/sleekxmpp/features/feature_rosterver/rosterver.py b/sleekxmpp/features/feature_rosterver/rosterver.py
index 9e0bb8e8..2991f587 100644
--- a/sleekxmpp/features/feature_rosterver/rosterver.py
+++ b/sleekxmpp/features/feature_rosterver/rosterver.py
@@ -8,7 +8,7 @@
import logging
-from sleekxmpp.stanza import Iq, StreamFeatures
+from sleekxmpp.stanza import StreamFeatures
from sleekxmpp.features.feature_rosterver import stanza
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.base import BasePlugin
diff --git a/sleekxmpp/plugins/xep_0082.py b/sleekxmpp/plugins/xep_0082.py
index 02571fa7..26eb68fa 100644
--- a/sleekxmpp/plugins/xep_0082.py
+++ b/sleekxmpp/plugins/xep_0082.py
@@ -6,7 +6,6 @@
See the file LICENSE for copying permission.
"""
-import logging
import datetime as dt
from sleekxmpp.plugins import BasePlugin, register_plugin
diff --git a/sleekxmpp/roster/__init__.py b/sleekxmpp/roster/__init__.py
index 4335d367..18b380c9 100644
--- a/sleekxmpp/roster/__init__.py
+++ b/sleekxmpp/roster/__init__.py
@@ -6,7 +6,6 @@
See the file LICENSE for copying permission.
"""
-from sleekxmpp.xmlstream import JID
from sleekxmpp.roster.item import RosterItem
from sleekxmpp.roster.single import RosterNode
from sleekxmpp.roster.multi import Roster
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index 901c3a56..04fb106d 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -9,14 +9,12 @@
import unittest
from xml.parsers.expat import ExpatError
-import sleekxmpp
from sleekxmpp import ClientXMPP, ComponentXMPP
from sleekxmpp.util import Queue
from sleekxmpp.stanza import Message, Iq, Presence
from sleekxmpp.test import TestSocket, TestLiveSocket
-from sleekxmpp.exceptions import XMPPError, IqTimeout, IqError
-from sleekxmpp.xmlstream import ET, register_stanza_plugin
-from sleekxmpp.xmlstream import ElementBase, StanzaBase
+from sleekxmpp.xmlstream import ET
+from sleekxmpp.xmlstream import ElementBase
from sleekxmpp.xmlstream.tostring import tostring
from sleekxmpp.xmlstream.matcher import StanzaPath, MatcherId
from sleekxmpp.xmlstream.matcher import MatchXMLMask, MatchXPath
diff --git a/sleekxmpp/thirdparty/socks.py b/sleekxmpp/thirdparty/socks.py
index a6c0d70e..9239a7b9 100644
--- a/sleekxmpp/thirdparty/socks.py
+++ b/sleekxmpp/thirdparty/socks.py
@@ -13,7 +13,7 @@ are permitted provided that the following conditions are met:
3. Neither the name of Dan Haim nor the names of his contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
@@ -28,9 +28,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE.
This module provides a standard socket-like interface for Python
for tunneling connections through SOCKS proxies.
-"""
-
-"""
Minor modifications made by Christopher Gilbert (http://motomastyle.com/)
for use in PyLoris (http://pyloris.sourceforge.net/)
@@ -42,7 +39,6 @@ mainly to merge bug fixes found in Sourceforge
import socket
import struct
-import sys
PROXY_TYPE_SOCKS4 = 1
PROXY_TYPE_SOCKS5 = 2
diff --git a/sleekxmpp/thirdparty/statemachine.py b/sleekxmpp/thirdparty/statemachine.py
index 4b5ecd6b..113320fa 100644
--- a/sleekxmpp/thirdparty/statemachine.py
+++ b/sleekxmpp/thirdparty/statemachine.py
@@ -15,7 +15,8 @@ log = logging.getLogger(__name__)
class StateMachine(object):
- def __init__(self, states=[]):
+ def __init__(self, states=None):
+ if not states: states = []
self.lock = threading.Condition()
self.__states = []
self.addStates(states)
diff --git a/sleekxmpp/util/stringprep_profiles.py b/sleekxmpp/util/stringprep_profiles.py
index 54793343..84326bc3 100644
--- a/sleekxmpp/util/stringprep_profiles.py
+++ b/sleekxmpp/util/stringprep_profiles.py
@@ -16,7 +16,6 @@
from __future__ import unicode_literals
-import sys
import stringprep
from unicodedata import ucd_3_2_0 as unicodedata
diff --git a/tests/test_events.py b/tests/test_events.py
index fb34be30..a41ed017 100644
--- a/tests/test_events.py
+++ b/tests/test_events.py
@@ -1,5 +1,6 @@
import time
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestEvents(SleekTest):
diff --git a/tests/test_jid.py b/tests/test_jid.py
index 76e56586..ed2aeea9 100644
--- a/tests/test_jid.py
+++ b/tests/test_jid.py
@@ -1,6 +1,7 @@
# -*- encoding: utf8 -*-
from __future__ import unicode_literals
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp import JID, InvalidJID
from sleekxmpp.jid import nodeprep
diff --git a/tests/test_stanza_base.py b/tests/test_stanza_base.py
index 9bd326b6..deb7ab96 100644
--- a/tests/test_stanza_base.py
+++ b/tests/test_stanza_base.py
@@ -1,4 +1,5 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.xmlstream.stanzabase import ET, StanzaBase
diff --git a/tests/test_stanza_element.py b/tests/test_stanza_element.py
index b7ccdb87..2b9676cf 100644
--- a/tests/test_stanza_element.py
+++ b/tests/test_stanza_element.py
@@ -1,5 +1,6 @@
-from sleekxmpp.test import *
-from sleekxmpp.xmlstream.stanzabase import ElementBase
+import unittest
+from sleekxmpp.test import SleekTest
+from sleekxmpp.xmlstream.stanzabase import ElementBase, register_stanza_plugin, ET
from sleekxmpp.thirdparty import OrderedDict
diff --git a/tests/test_stanza_error.py b/tests/test_stanza_error.py
index a41bf4bf..d95a33ce 100644
--- a/tests/test_stanza_error.py
+++ b/tests/test_stanza_error.py
@@ -1,4 +1,5 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestErrorStanzas(SleekTest):
diff --git a/tests/test_stanza_gmail.py b/tests/test_stanza_gmail.py
index 6190c608..a15fea20 100644
--- a/tests/test_stanza_gmail.py
+++ b/tests/test_stanza_gmail.py
@@ -1,5 +1,8 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp import Iq
+from sleekxmpp.test import SleekTest
import sleekxmpp.plugins.gmail_notify as gmail
+from sleekxmpp.xmlstream import register_stanza_plugin, ET
class TestGmail(SleekTest):
diff --git a/tests/test_stanza_iq.py b/tests/test_stanza_iq.py
index 42e4dcde..0f5e30b0 100644
--- a/tests/test_stanza_iq.py
+++ b/tests/test_stanza_iq.py
@@ -1,4 +1,5 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.xmlstream.stanzabase import ET
diff --git a/tests/test_stanza_message.py b/tests/test_stanza_message.py
index 3ed965b6..9968a630 100644
--- a/tests/test_stanza_message.py
+++ b/tests/test_stanza_message.py
@@ -1,6 +1,8 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.stanza.message import Message
from sleekxmpp.stanza.htmlim import HTMLIM
+from sleekxmpp.xmlstream import register_stanza_plugin
class TestMessageStanzas(SleekTest):
diff --git a/tests/test_stanza_presence.py b/tests/test_stanza_presence.py
index 2ec43b65..184dce96 100644
--- a/tests/test_stanza_presence.py
+++ b/tests/test_stanza_presence.py
@@ -1,6 +1,6 @@
-from sleekxmpp.test import *
-from sleekxmpp.stanza.presence import Presence
-
+import unittest
+import sleekxmpp
+from sleekxmpp.test import SleekTest
class TestPresenceStanzas(SleekTest):
diff --git a/tests/test_stanza_roster.py b/tests/test_stanza_roster.py
index 8ec2d32b..d121568b 100644
--- a/tests/test_stanza_roster.py
+++ b/tests/test_stanza_roster.py
@@ -1,5 +1,6 @@
-from sleekxmpp.test import *
-from sleekxmpp.stanza.roster import Roster
+import unittest
+from sleekxmpp.test import SleekTest
+from sleekxmpp.xmlstream import ET
class TestRosterStanzas(SleekTest):
diff --git a/tests/test_stanza_xep_0004.py b/tests/test_stanza_xep_0004.py
index e183e5e9..9056c663 100644
--- a/tests/test_stanza_xep_0004.py
+++ b/tests/test_stanza_xep_0004.py
@@ -1,7 +1,10 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp import Message
+from sleekxmpp.test import SleekTest
from sleekxmpp.thirdparty import OrderedDict
import sleekxmpp.plugins.xep_0004 as xep_0004
+from sleekxmpp.xmlstream import register_stanza_plugin
class TestDataForms(SleekTest):
diff --git a/tests/test_stanza_xep_0030.py b/tests/test_stanza_xep_0030.py
index 2d64988d..986c1880 100644
--- a/tests/test_stanza_xep_0030.py
+++ b/tests/test_stanza_xep_0030.py
@@ -1,5 +1,8 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp import Iq
+from sleekxmpp.test import SleekTest
import sleekxmpp.plugins.xep_0030 as xep_0030
+from sleekxmpp.xmlstream import register_stanza_plugin
class TestDisco(SleekTest):
diff --git a/tests/test_stanza_xep_0033.py b/tests/test_stanza_xep_0033.py
index ec9a5309..bf10cf6c 100644
--- a/tests/test_stanza_xep_0033.py
+++ b/tests/test_stanza_xep_0033.py
@@ -1,5 +1,8 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp import Message
+from sleekxmpp.test import SleekTest
import sleekxmpp.plugins.xep_0033 as xep_0033
+from sleekxmpp.xmlstream import register_stanza_plugin
class TestAddresses(SleekTest):
diff --git a/tests/test_stanza_xep_0047.py b/tests/test_stanza_xep_0047.py
index 6aa2314b..9fd3c4d6 100644
--- a/tests/test_stanza_xep_0047.py
+++ b/tests/test_stanza_xep_0047.py
@@ -1,5 +1,9 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.exceptions import XMPPError
+from sleekxmpp import Iq
+from sleekxmpp.test import SleekTest
from sleekxmpp.plugins.xep_0047 import Data
+from sleekxmpp.xmlstream import register_stanza_plugin, ET
class TestIBB(SleekTest):
diff --git a/tests/test_stanza_xep_0050.py b/tests/test_stanza_xep_0050.py
index e02e86c3..9d49b3ee 100644
--- a/tests/test_stanza_xep_0050.py
+++ b/tests/test_stanza_xep_0050.py
@@ -1,6 +1,8 @@
from sleekxmpp import Iq
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.plugins.xep_0050 import Command
+from sleekxmpp.xmlstream import register_stanza_plugin
class TestAdHocCommandStanzas(SleekTest):
diff --git a/tests/test_stanza_xep_0059.py b/tests/test_stanza_xep_0059.py
index 913436a6..860ec869 100644
--- a/tests/test_stanza_xep_0059.py
+++ b/tests/test_stanza_xep_0059.py
@@ -1,5 +1,7 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.plugins.xep_0059 import Set
+from sleekxmpp.xmlstream import ET
class TestSetStanzas(SleekTest):
diff --git a/tests/test_stanza_xep_0060.py b/tests/test_stanza_xep_0060.py
index 3898d0ab..332b53ea 100644
--- a/tests/test_stanza_xep_0060.py
+++ b/tests/test_stanza_xep_0060.py
@@ -1,6 +1,8 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
import sleekxmpp.plugins.xep_0004 as xep_0004
import sleekxmpp.plugins.xep_0060.stanza as pubsub
+from sleekxmpp.xmlstream.stanzabase import ET
class TestPubsubStanzas(SleekTest):
diff --git a/tests/test_stanza_xep_0085.py b/tests/test_stanza_xep_0085.py
index 61784e47..303e6c5b 100644
--- a/tests/test_stanza_xep_0085.py
+++ b/tests/test_stanza_xep_0085.py
@@ -1,5 +1,9 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp import Message
+from sleekxmpp.test import SleekTest
import sleekxmpp.plugins.xep_0085 as xep_0085
+from sleekxmpp.xmlstream import register_stanza_plugin
+
class TestChatStates(SleekTest):
diff --git a/tests/test_stanza_xep_0184.py b/tests/test_stanza_xep_0184.py
index 13472373..0c340487 100644
--- a/tests/test_stanza_xep_0184.py
+++ b/tests/test_stanza_xep_0184.py
@@ -1,5 +1,8 @@
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp import Message
+from sleekxmpp.test import SleekTest
import sleekxmpp.plugins.xep_0184 as xep_0184
+from sleekxmpp.xmlstream import register_stanza_plugin
class TestReciept(SleekTest):
diff --git a/tests/test_stream.py b/tests/test_stream.py
index deac24a5..f68f8426 100644
--- a/tests/test_stream.py
+++ b/tests/test_stream.py
@@ -1,5 +1,6 @@
import time
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamTester(SleekTest):
diff --git a/tests/test_stream_exceptions.py b/tests/test_stream_exceptions.py
index c41edbb2..d18d059a 100644
--- a/tests/test_stream_exceptions.py
+++ b/tests/test_stream_exceptions.py
@@ -1,9 +1,8 @@
-import sys
-import sleekxmpp
from sleekxmpp.xmlstream.matcher import MatchXPath
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.exceptions import XMPPError
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamExceptions(SleekTest):
diff --git a/tests/test_stream_filters.py b/tests/test_stream_filters.py
index ef4d5dc8..ee17ffdc 100644
--- a/tests/test_stream_filters.py
+++ b/tests/test_stream_filters.py
@@ -1,9 +1,8 @@
import time
from sleekxmpp import Message
-from sleekxmpp.test import *
-from sleekxmpp.xmlstream.handler import *
-from sleekxmpp.xmlstream.matcher import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestFilters(SleekTest):
@@ -84,5 +83,5 @@ class TestFilters(SleekTest):
""")
-
+
suite = unittest.TestLoader().loadTestsFromTestCase(TestFilters)
diff --git a/tests/test_stream_handlers.py b/tests/test_stream_handlers.py
index 183e4bf9..ef46da6a 100644
--- a/tests/test_stream_handlers.py
+++ b/tests/test_stream_handlers.py
@@ -1,9 +1,9 @@
import time
-from sleekxmpp import Message
-from sleekxmpp.test import *
-from sleekxmpp.xmlstream.handler import *
-from sleekxmpp.xmlstream.matcher import *
+import unittest
+from sleekxmpp.test import SleekTest
+from sleekxmpp.exceptions import IqTimeout
+from sleekxmpp import Callback, MatchXPath
class TestHandlers(SleekTest):
diff --git a/tests/test_stream_presence.py b/tests/test_stream_presence.py
index 4f2ede16..365a09ed 100644
--- a/tests/test_stream_presence.py
+++ b/tests/test_stream_presence.py
@@ -1,5 +1,6 @@
import time
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamPresence(SleekTest):
diff --git a/tests/test_stream_roster.py b/tests/test_stream_roster.py
index fa87105e..221954ab 100644
--- a/tests/test_stream_roster.py
+++ b/tests/test_stream_roster.py
@@ -1,8 +1,9 @@
# -*- encoding:utf-8 -*-
-
from __future__ import unicode_literals
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.exceptions import IqTimeout
+from sleekxmpp.test import SleekTest
import time
import threading
diff --git a/tests/test_stream_xep_0030.py b/tests/test_stream_xep_0030.py
index dd43778a..37d29d33 100644
--- a/tests/test_stream_xep_0030.py
+++ b/tests/test_stream_xep_0030.py
@@ -1,8 +1,8 @@
-import sys
import time
import threading
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamDisco(SleekTest):
diff --git a/tests/test_stream_xep_0047.py b/tests/test_stream_xep_0047.py
index 8c46606e..0515bca5 100644
--- a/tests/test_stream_xep_0047.py
+++ b/tests/test_stream_xep_0047.py
@@ -1,7 +1,8 @@
import threading
import time
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestInBandByteStreams(SleekTest):
diff --git a/tests/test_stream_xep_0050.py b/tests/test_stream_xep_0050.py
index 5ad9d6ae..261a0057 100644
--- a/tests/test_stream_xep_0050.py
+++ b/tests/test_stream_xep_0050.py
@@ -1,8 +1,9 @@
import time
import logging
-import threading
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
+from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin
class TestAdHocCommands(SleekTest):
@@ -35,7 +36,7 @@ class TestAdHocCommands(SleekTest):
logging.debug(initial)
new_payload = TestPayload()
if initial:
- new_payload['bar'] = 'Received: %s' % initial['bar']
+ new_payload['bar'] = 'Received: %s' % initial['bar']
else:
new_payload['bar'] = 'Failed'
diff --git a/tests/test_stream_xep_0059.py b/tests/test_stream_xep_0059.py
index 249ecf66..5f3ea079 100644
--- a/tests/test_stream_xep_0059.py
+++ b/tests/test_stream_xep_0059.py
@@ -1,6 +1,7 @@
import threading
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.xep_0030 import DiscoItems
from sleekxmpp.plugins.xep_0059 import ResultIterator, Set
diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py
index 0ad14b02..581d5d00 100644
--- a/tests/test_stream_xep_0060.py
+++ b/tests/test_stream_xep_0060.py
@@ -1,8 +1,7 @@
-import sys
-import time
import threading
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
from sleekxmpp.stanza.atom import AtomEntry
from sleekxmpp.xmlstream import register_stanza_plugin
diff --git a/tests/test_stream_xep_0066.py b/tests/test_stream_xep_0066.py
index e3f2ddfa..175026d2 100644
--- a/tests/test_stream_xep_0066.py
+++ b/tests/test_stream_xep_0066.py
@@ -1,7 +1,7 @@
-import time
import threading
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestOOB(SleekTest):
diff --git a/tests/test_stream_xep_0085.py b/tests/test_stream_xep_0085.py
index 2a814805..54e7e15f 100644
--- a/tests/test_stream_xep_0085.py
+++ b/tests/test_stream_xep_0085.py
@@ -1,7 +1,7 @@
-import threading
import time
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamChatStates(SleekTest):
diff --git a/tests/test_stream_xep_0092.py b/tests/test_stream_xep_0092.py
index a3960fa2..c0748697 100644
--- a/tests/test_stream_xep_0092.py
+++ b/tests/test_stream_xep_0092.py
@@ -1,6 +1,7 @@
import threading
-from sleekxmpp.test import *
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamSet(SleekTest):
diff --git a/tests/test_stream_xep_0128.py b/tests/test_stream_xep_0128.py
index 42fc9143..10222d9b 100644
--- a/tests/test_stream_xep_0128.py
+++ b/tests/test_stream_xep_0128.py
@@ -1,9 +1,5 @@
-import sys
-import time
-import threading
-
-from sleekxmpp.test import *
-from sleekxmpp.xmlstream import ElementBase
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamExtendedDisco(SleekTest):
diff --git a/tests/test_stream_xep_0249.py b/tests/test_stream_xep_0249.py
index 9a25253f..8edea270 100644
--- a/tests/test_stream_xep_0249.py
+++ b/tests/test_stream_xep_0249.py
@@ -1,9 +1,7 @@
-import sys
import time
-import threading
-from sleekxmpp.test import *
-from sleekxmpp.xmlstream import ElementBase
+import unittest
+from sleekxmpp.test import SleekTest
class TestStreamDirectInvite(SleekTest):
diff --git a/tests/test_tostring.py b/tests/test_tostring.py
index 8c04f00c..e6148533 100644
--- a/tests/test_tostring.py
+++ b/tests/test_tostring.py
@@ -1,6 +1,6 @@
-from sleekxmpp.test import *
-from sleekxmpp.stanza import Message
-from sleekxmpp.xmlstream.stanzabase import ET, ElementBase
+import unittest
+from sleekxmpp.test import SleekTest
+from sleekxmpp.xmlstream.stanzabase import ET
from sleekxmpp.xmlstream.tostring import tostring, escape