Merge branch 'fix-tests' into 'master'
Fix tests and stop misusing __all__ See merge request poezio/slixmpp!229
This commit is contained in:
commit
1f934d375c
4 changed files with 15 additions and 5 deletions
|
@ -279,10 +279,10 @@ class BaseXMPP(XMLStream):
|
||||||
if self.plugin_whitelist:
|
if self.plugin_whitelist:
|
||||||
plugin_list = self.plugin_whitelist
|
plugin_list = self.plugin_whitelist
|
||||||
else:
|
else:
|
||||||
plugin_list = plugins.__all__
|
plugin_list = plugins.PLUGINS
|
||||||
|
|
||||||
for plugin in plugin_list:
|
for plugin in plugin_list:
|
||||||
if plugin in plugins.__all__:
|
if plugin in plugins.PLUGINS:
|
||||||
self.register_plugin(plugin)
|
self.register_plugin(plugin)
|
||||||
else:
|
else:
|
||||||
raise NameError("Plugin %s not in plugins.__all__." % plugin)
|
raise NameError("Plugin %s not in plugins.__all__." % plugin)
|
||||||
|
|
|
@ -6,7 +6,7 @@ from slixmpp.plugins.base import PluginManager, PluginNotFound, BasePlugin
|
||||||
from slixmpp.plugins.base import register_plugin, load_plugin
|
from slixmpp.plugins.base import register_plugin, load_plugin
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
PLUGINS = [
|
||||||
# XEPS
|
# XEPS
|
||||||
'xep_0004', # Data Forms
|
'xep_0004', # Data Forms
|
||||||
'xep_0009', # Jabber-RPC
|
'xep_0009', # Jabber-RPC
|
||||||
|
@ -116,5 +116,12 @@ __all__ = [
|
||||||
'xep_0444', # Message Reactions
|
'xep_0444', # Message Reactions
|
||||||
'xep_0461', # Message Replies
|
'xep_0461', # Message Replies
|
||||||
# Meant to be imported by plugins
|
# Meant to be imported by plugins
|
||||||
'BasePlugin'
|
]
|
||||||
|
|
||||||
|
__all__ = PLUGINS + [
|
||||||
|
'PluginManager',
|
||||||
|
'PluginNotFound',
|
||||||
|
'BasePlugin',
|
||||||
|
'register_plugin',
|
||||||
|
'load_plugin',
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import datetime
|
import datetime
|
||||||
|
import unittest
|
||||||
|
|
||||||
from slixmpp import Iq
|
from slixmpp import Iq
|
||||||
from slixmpp.test import SlixTest
|
from slixmpp.test import SlixTest
|
||||||
|
@ -116,3 +117,5 @@ class TestVcard(SlixTest):
|
||||||
""",
|
""",
|
||||||
use_values=False
|
use_values=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestVcard)
|
||||||
|
|
|
@ -33,7 +33,7 @@ class TestReply(SlixTest):
|
||||||
self.check(
|
self.check(
|
||||||
message,
|
message,
|
||||||
"""
|
"""
|
||||||
<message xmlns="jabber:client">M
|
<message xmlns="jabber:client">
|
||||||
<body>12345\nrealbody</body>
|
<body>12345\nrealbody</body>
|
||||||
<fallback xmlns='urn:xmpp:feature-fallback:0' for='NS'>
|
<fallback xmlns='urn:xmpp:feature-fallback:0' for='NS'>
|
||||||
<body start="0" end="6" />
|
<body start="0" end="6" />
|
||||||
|
|
Loading…
Reference in a new issue