[Kimchi-devel] [PATCH V9 8/9] skip plugins test, when sample plugin is not enabled

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Fri Jun 13 10:28:53 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

The plugins tests base on the sample plugin.
So we should skip the tests when disable sample plugin

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 tests/test_plugin.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index 7773a0e..4c7ff1e 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -27,6 +27,7 @@
 
 import kimchi.mockmodel
 import kimchi.server
+from kimchi.utils import get_enabled_plugins
 import utils
 
 
@@ -53,6 +54,9 @@ def tearDownModule():
     os.unlink('/tmp/obj-store-test')
 
 
+ at unittest.skipUnless(
+     'sample' in [plugin for plugin, _config in get_enabled_plugins()],
+     'sample plugin is not enabled, skip this test!')
 class PluginTests(unittest.TestCase):
 
     def setUp(self):
-- 
1.9.3




More information about the Kimchi-devel mailing list