[Kimchi-devel] [PATCH] [Kimchi 2/2] Add network rename tests
Lucio Correia
luciojhc at linux.vnet.ibm.com
Tue Apr 12 14:47:01 UTC 2016
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')
+ 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)
--
1.9.1
More information about the Kimchi-devel
mailing list