[Kimchi-devel] [PATCH V4 3/4] add template_delete to rollback after create a template
Shu Ming
shuming at linux.vnet.ibm.com
Fri Mar 21 02:09:26 UTC 2014
Reviewed-by: Shu Ming <shuming at linux.vnet.ibm.com>
2014-03-21Fri的 07:34 +0800,shaohef at linux.vnet.ibm.com:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> We know ModelTests will tear down the template datebase.
> But it is 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 | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tests/test_model.py b/tests/test_model.py
> index c8c54c0..69f9b5b 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -513,9 +513,11 @@ 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')
> + rollback.prependDefer(inst.template_delete, ident)
> clone_temp = inst.template_lookup(ident)
>
> clone_temp['name'] = orig_temp['name']
More information about the Kimchi-devel
mailing list