|
4 | 4 | from .. import flika |
5 | 5 | import numpy as np |
6 | 6 |
|
7 | | -# class TestPluginManager(): |
8 | | -# def setup_method(self, method): |
9 | | -# flika.start_flika() |
10 | | -# PluginManager.show() |
| 7 | +class TestPluginManager(): |
| 8 | + def setup_method(self, method): |
| 9 | + flika.start_flika() |
| 10 | + PluginManager.show() |
11 | 11 |
|
12 | | -# def teardown_method(self, method): |
13 | | -# PluginManager.close() |
14 | | - |
15 | | -# def test_local_plugins(self): |
16 | | -# local = set(plugin_list.keys()) |
17 | | -# plugins = set(PluginManager.plugins.keys()) |
18 | | - |
19 | | -# assert (local & plugins) == local, "Local plugin list not loaded correctly" |
20 | | - |
21 | | -# def test_install_plugin(self): |
22 | | -# plugin_name = 'Detect Puffs' |
23 | | -# if PluginManager.plugins[plugin_name].installed: |
24 | | -# return |
25 | | -# PluginManager.refresh_online_plugins() |
26 | | -# i = 0 |
27 | | -# while PluginManager.plugins[plugin_name].url == None: |
28 | | -# i += 1 |
29 | | -# if i == 1000: |
30 | | -# return |
31 | | -# continue |
32 | | -# PluginManager.downloadPlugin(plugin_name) |
33 | | -# assert PluginManager.plugins[plugin_name].menu is not None and PluginManager.plugins[plugin_name].installed, "Plugin install" |
34 | | -# PluginManager.removePlugin(plugin_name) |
35 | | -# assert PluginManager.plugins[plugin_name].menu is None and not PluginManager.plugins[plugin_name].installed, "Plugin uninstall" |
| 12 | + def teardown_method(self, method): |
| 13 | + PluginManager.close() |
| 14 | + |
| 15 | + def test_local_plugins(self): |
| 16 | + local = set(plugin_list.keys()) |
| 17 | + plugins = set(PluginManager.plugins.keys()) |
| 18 | + |
| 19 | + assert (local & plugins) == local, "Local plugin list not loaded correctly" |
| 20 | + |
| 21 | + def test_install_plugin(self): |
| 22 | + plugin_name = 'Detect Puffs' |
| 23 | + if PluginManager.plugins[plugin_name].installed: |
| 24 | + return |
| 25 | + PluginManager.refresh_online_plugins() |
| 26 | + i = 0 |
| 27 | + while PluginManager.plugins[plugin_name].url == None: |
| 28 | + i += 1 |
| 29 | + if i == 1000: |
| 30 | + return |
| 31 | + continue |
| 32 | + PluginManager.downloadPlugin(plugin_name) |
| 33 | + assert PluginManager.plugins[plugin_name].menu is not None and PluginManager.plugins[plugin_name].installed, "Plugin install" |
| 34 | + PluginManager.removePlugin(plugin_name) |
| 35 | + assert PluginManager.plugins[plugin_name].menu is None and not PluginManager.plugins[plugin_name].installed, "Plugin uninstall" |
36 | 36 |
|
37 | 37 |
|
38 | 38 | class TestScriptEditor(): |
|
0 commit comments