From b963d34cf14577dc3d35b4382961ded1004bc0b5 Mon Sep 17 00:00:00 2001 From: prieto Date: Wed, 8 Jun 2016 10:14:52 +0200 Subject: [PATCH] Added tests plugins --- tests/plugin/test_plugin.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/plugin/test_plugin.py b/tests/plugin/test_plugin.py index abcc859..a63092b 100644 --- a/tests/plugin/test_plugin.py +++ b/tests/plugin/test_plugin.py @@ -3,6 +3,8 @@ import unittest from lodel.plugin.plugins import Plugin, PluginError +from lodel.settings.settings import Settings +import tests.loader_utils class PluginTestCase(unittest.TestCase): @@ -13,13 +15,13 @@ class PluginTestCase(unittest.TestCase): # With a wrong plugin name, a NameError Exception has to be raised at line 318 of plugin.py def test_plugin_init_wrong_name(self): with self.assertRaises(NameError): - Plugin.start(['/home/helene/lodel2/plugins'],['wrong_plugin_name']) + Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins' ],['wrong_plugin_name']) Plugin.clear() # With a wrong plugin name, a NameError Exception has to be raised at line 318 of plugin.py def test_plugin_init_right_wrong_name(self): with self.assertRaises(NameError): - Plugin.start(['/home/helene/lodel2/plugins'],['dummy', 'wrong_plugin_name']) + Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins'],['dummy', 'wrong_plugin_name']) Plugin.clear() def test_plugin_started(self): @@ -27,12 +29,12 @@ class PluginTestCase(unittest.TestCase): Plugin.started() def test_plugin_plugin_path(self): - Plugin.start(['/home/helene/lodel2/plugins'],['dummy']) + Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins'],['dummy']) self.assertEqual(Plugin.plugin_path('dummy'), '/home/helene/lodel2/plugins/dummy/') Plugin.clear() def test_plugin_get(self): - Plugin.start(['/home/helene/lodel2/plugins'],['dummy']) + Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins'],['dummy']) with self.assertRaises(PluginError): Plugin.get('wrong_plugin_name') self.assertTrue(isinstance(Plugin.get('dummy'), Plugin)) @@ -47,6 +49,8 @@ class PluginTestCase(unittest.TestCase): Plugin.clear() def test_plugin_load_all(self): + #Plugin.start(['/home/helene/lodel2/plugins'],['dummynotactivable']) + #Plugin.load_all() pass