[Kimchi-devel] [PATCH V2 3/4] add template_delete to rollback after create a template

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Mon Mar 17 09:44:58 UTC 2014


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

We know ModelTests will tear down the template datebase.
But it is more better to delete the template explicitly.
In this way, the test case also can test the template_delete.

Also this can make pyflakes happy.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
 tests/test_model.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/test_model.py b/tests/test_model.py
index 60d0b94..a3bfe88 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -513,6 +513,7 @@ class ModelTests(unittest.TestCase):
             orig_params = {'name': 'test-template', 'memory': 1024,
                            'cpus': 1, 'cdrom': self.kimchi_iso}
             inst.templates_create(orig_params)
+            rollback.prependDefer(inst.template_delete, 'test-template')
             orig_temp = inst.template_lookup(orig_params['name'])
 
             ident = inst.template_clone('test-template')
-- 
1.8.5.3




More information about the Kimchi-devel mailing list