[Kimchi-devel] [PATCH 2/3] add template_delete to rollback after create a template
Sheldon
shaohef at linux.vnet.ibm.com
Thu Mar 13 03:31:12 UTC 2014
On 03/13/2014 11:13 AM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> We know ModelTests will tear down the template datebase.
s/datebas/database
> 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>
> ---
> tests/test_model.py | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tests/test_model.py b/tests/test_model.py
> index a3d8eff..5f797dc 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -501,6 +501,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')
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef at linux.vnet.ibm.com>
IBM Linux Technology Center
More information about the Kimchi-devel
mailing list