[Kimchi-devel] [PATCH] [Kimchi 2/2] Add network rename tests

Aline Manera alinefm at linux.vnet.ibm.com
Wed Apr 13 17:30:27 UTC 2016



On 04/12/2016 11:47 AM, Lucio Correia wrote:
> Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
> ---
>   tests/test_model_network.py | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tests/test_model_network.py b/tests/test_model_network.py
> index e27036d..ccb2c4d 100644
> --- a/tests/test_model_network.py
> +++ b/tests/test_model_network.py
> @@ -92,8 +92,19 @@ def _do_network_test(self, model, params):
>           network = json.loads(resp.read())
>           self.assertEquals('inactive', network['state'])

> +        # Edit (rename) the network
> +        params['name'] += u'renamed'
> +        params.pop('connection')

What is in params already? It is better (at least to review) to create a 
new group of parameters so we can easily identify which parameters you 
are trying to update.

> +        req = json.dumps(params)
> +        resp = self.request(uri, req, 'PUT')
> +        self.assertEquals(303, resp.status)
> +
> +        # Assert old name does not exist anymore
> +        resp = self.request(uri, '{}', 'GET')
> +        self.assertEquals(404, resp.status)
> +
>           # Delete the network
> -        resp = self.request(uri, '{}', 'DELETE')
> +        resp = self.request(uri + 'renamed'.encode('utf-8'), '{}', 'DELETE')
>           self.assertEquals(204, resp.status)
>

Please, also add tests to edit the other parameters: subnet, iface, 
dhcp, etc.





More information about the Kimchi-devel mailing list