From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
$ sudo ./run_tests.sh test_rest
Failed to import plugin plugins.sample.Drawings
That's because plugin is not in src/
Add the plugin path in run_tests.sh
Remove the plugin path from test_plugin.py
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
tests/run_tests.sh.in | 4 ++--
tests/test_plugin.py | 3 ---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/tests/run_tests.sh.in b/tests/run_tests.sh.in
index 2baf66d..038e8fa 100644
--- a/tests/run_tests.sh.in
+++ b/tests/run_tests.sh.in
@@ -31,7 +31,7 @@ else
fi
if [ "$HAVE_UNITTEST" != "yes" -o "$PYTHON_VER" ==
"2.6" ]; then
- PYTHONPATH=../src:./ unit2 $ARGS
+ PYTHONPATH=../src:./:../ unit2 $ARGS
else
- PYTHONPATH=../src python -m unittest $ARGS
+ PYTHONPATH=../src:../ python -m unittest $ARGS
fi
diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index 42c87a9..607dd55 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -22,7 +22,6 @@
import json
import os
-import sys
import unittest
@@ -32,7 +31,6 @@ from functools import partial
import kimchi.mockmodel
import kimchi.server
import utils
-from kimchi import config
test_server = None
@@ -48,7 +46,6 @@ def setUpModule():
host = '127.0.0.1'
port = utils.get_free_port('http')
ssl_port = None
- sys.path.append(config.get_prefix())
test_server = utils.run_server(host, port, ssl_port, test_mode=True,
model=model)
--
1.8.4.2