From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Because test_model have singleton import for its whole life cycle,
the dict of singleton class not cleared even though instance deleted.
Hack it so that model instance can be generated again.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
tests/test_model.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/test_model.py b/tests/test_model.py
index a08b3d9..f5989a9 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -33,6 +33,7 @@ import iso_gen
import kimchi.objectstore
import utils
from kimchi import netinfo
+from kimchi.basemodel import Singleton
from kimchi.exception import InvalidOperation, InvalidParameter
from kimchi.exception import NotFoundError, OperationFailed
from kimchi.iscsi import TargetClient
@@ -46,6 +47,7 @@ class ModelTests(unittest.TestCase):
self.tmp_store = '/tmp/kimchi-store-test'
def tearDown(self):
+ Singleton._instances = {}
os.unlink(self.tmp_store)
def test_vm_info(self):
--
1.8.1.2