[Kimchi-devel] [PATCH] [Kimchi 2/2] Add network rename tests
Lucio Correia
luciojhc at linux.vnet.ibm.com
Wed Apr 13 19:10:41 UTC 2016
On 13-04-2016 14:30, Aline Manera wrote:
>
>
> 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.
This is only a rename test added for the already existing network types
in tests. Since there are various network types handled by this code (a
loop), we would need to specify the parameters according to the type.
>
>> + 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.
OK, subnet, iface, vlan_id.
>
>
--
Lucio Correia
Software Engineer
IBM LTC Brazil
More information about the Kimchi-devel
mailing list