瀏覽代碼

Added tests plugins

prieto 8 年之前
父節點
當前提交
b963d34cf1
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8
    4
      tests/plugin/test_plugin.py

+ 8
- 4
tests/plugin/test_plugin.py 查看文件

@@ -3,6 +3,8 @@
3 3
 import unittest
4 4
 
5 5
 from lodel.plugin.plugins import Plugin, PluginError
6
+from lodel.settings.settings import Settings
7
+import tests.loader_utils
6 8
 
7 9
 class PluginTestCase(unittest.TestCase):
8 10
 
@@ -13,13 +15,13 @@ class PluginTestCase(unittest.TestCase):
13 15
     # With a wrong plugin name, a NameError Exception has to be raised at line 318 of plugin.py
14 16
     def test_plugin_init_wrong_name(self):
15 17
         with self.assertRaises(NameError):
16
-            Plugin.start(['/home/helene/lodel2/plugins'],['wrong_plugin_name'])
18
+            Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins' ],['wrong_plugin_name'])
17 19
         Plugin.clear()
18 20
         
19 21
     # With a wrong plugin name, a NameError Exception has to be raised at line 318 of plugin.py
20 22
     def test_plugin_init_right_wrong_name(self):
21 23
         with self.assertRaises(NameError):
22
-            Plugin.start(['/home/helene/lodel2/plugins'],['dummy', 'wrong_plugin_name'])
24
+            Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins'],['dummy', 'wrong_plugin_name'])
23 25
         Plugin.clear()
24 26
     
25 27
     def test_plugin_started(self):
@@ -27,12 +29,12 @@ class PluginTestCase(unittest.TestCase):
27 29
             Plugin.started()
28 30
             
29 31
     def test_plugin_plugin_path(self):
30
-        Plugin.start(['/home/helene/lodel2/plugins'],['dummy'])
32
+        Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins'],['dummy'])
31 33
         self.assertEqual(Plugin.plugin_path('dummy'), '/home/helene/lodel2/plugins/dummy/')
32 34
         Plugin.clear()
33 35
         
34 36
     def test_plugin_get(self):
35
-        Plugin.start(['/home/helene/lodel2/plugins'],['dummy'])
37
+        Plugin.start(['/home/helene/lodel2/plugins', '/home/helene/lodel2/tests/tests_plugins'],['dummy'])
36 38
         with self.assertRaises(PluginError):
37 39
             Plugin.get('wrong_plugin_name')
38 40
         self.assertTrue(isinstance(Plugin.get('dummy'), Plugin))
@@ -47,6 +49,8 @@ class PluginTestCase(unittest.TestCase):
47 49
         Plugin.clear()
48 50
         
49 51
     def test_plugin_load_all(self):
52
+        #Plugin.start(['/home/helene/lodel2/plugins'],['dummynotactivable'])
53
+        #Plugin.load_all()
50 54
         pass
51 55
         
52 56
     

Loading…
取消
儲存