Browse Source

Updated tests on Plugin class

The Plugin class and discover steps were updated. Some test are deleted
because they were obsolete (discover method do not take any argument
anymore)
Yann Weber 8 years ago
parent
commit
d89203665b
1 changed files with 1 additions and 33 deletions
  1. 1
    33
      tests/plugin/test_plugin.py

+ 1
- 33
tests/plugin/test_plugin.py View File

3
 import unittest
3
 import unittest
4
 
4
 
5
 from lodel.plugin.plugins import Plugin, PluginError, MetaPlugType,\
5
 from lodel.plugin.plugins import Plugin, PluginError, MetaPlugType,\
6
-    VIRTUAL_PACKAGE_NAME, DEFAULT_PLUGINS_PATH_LIST
6
+    VIRTUAL_PACKAGE_NAME, PLUGINS_PATH
7
 from lodel.plugin.datasource_plugin import DatasourcePlugin
7
 from lodel.plugin.datasource_plugin import DatasourcePlugin
8
 from lodel.plugin.sessionhandler import SessionHandlerPlugin
8
 from lodel.plugin.sessionhandler import SessionHandlerPlugin
9
 from lodel.plugin.interface import InterfacePlugin
9
 from lodel.plugin.interface import InterfacePlugin
83
         self.assertEqual(Plugin.plugin_module_name('foo'), "%s.%s" % (VIRTUAL_PACKAGE_NAME, 'foo'))
83
         self.assertEqual(Plugin.plugin_module_name('foo'), "%s.%s" % (VIRTUAL_PACKAGE_NAME, 'foo'))
84
         
84
         
85
         
85
         
86
-    def test_discover_if_paths_is_none_default_is_used(self):
87
-        with patch.object(Plugin, '_discover', wraps=Plugin._discover) as _discover_wrap:
88
-            Plugin.discover(DEFAULT_PLUGINS_PATH_LIST)
89
-            _discover_wrap.assert_called_with(DEFAULT_PLUGINS_PATH_LIST[-1])
90
-            
91
-        
92
-    def test_discover_if_paths_is_set_properly_search_in(self):
93
-        paths = ['.', '.']
94
-        with patch.object(Plugin, '_discover', wraps=Plugin._discover) as _discover_wrap:
95
-            Plugin.discover(paths)
96
-            _discover_wrap.assert_called_with(paths[-1])
97
-            
98
-            
99
-    def test_discover_if_no_plugins_found_still_returns_searched_paths(self):
100
-        paths = ['/home/quentin/Pictures']
101
-        dfoi = Plugin.discover(paths)
102
-        self.assertEqual(dfoi['path_list'], paths)
103
-        
104
-            
105
-    def test_discover_if_no_plugins_found_returns_empty_plugin_dict(self):
106
-        dfoi = Plugin.discover(['/home/quentin/Pictures'])
107
-        self.assertEqual(dfoi['plugins'], {})
108
-        
109
-            
110
-    def test_discover_if_no_plugins_found_returns_empty_plugin(self):
111
-        dfoi = Plugin.discover(['./plugins'])
112
-        self.maxDiff = None
113
-        self.assertEqual(dfoi['plugins'], {})
114
-        
115
-
116
-
117
-
118
 class PluginStartedTestCase(unittest.TestCase):
86
 class PluginStartedTestCase(unittest.TestCase):
119
     """ Test case grouping all tests on a started Plugin class """
87
     """ Test case grouping all tests on a started Plugin class """
120
 
88
 

Loading…
Cancel
Save