From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
update test_rest and test_model
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
tests/test_model.py | 1 +
tests/test_rest.py | 3 +++
2 files changed, 4 insertions(+)
diff --git a/tests/test_model.py b/tests/test_model.py
index c689bcc..0620501 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -410,6 +410,7 @@ class ModelTests(unittest.TestCase):
self.assertEquals(args['subnet'], networkinfo['subnet'])
self.assertEqual(args['connection'],
networkinfo['connection'])
self.assertEquals('inactive', networkinfo['state'])
+ self.assertEquals([], networkinfo['vms'])
self.assertTrue(networkinfo['autostart'])
inst.network_activate(name)
diff --git a/tests/test_rest.py b/tests/test_rest.py
index a960868..8732781 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -875,6 +875,7 @@ class RestTests(unittest.TestCase):
networks = json.loads(request(host, port, '/networks').read())
self.assertEquals(1, len(networks))
self.assertEquals('default', networks[0]['name'])
+ self.assertEquals([], networks[0]['vms'])
# Now add a couple of Networks to the mock model
for i in xrange(5):
@@ -885,6 +886,8 @@ class RestTests(unittest.TestCase):
resp = request(host, port, '/networks', req, 'POST')
self.assertEquals(201, resp.status)
+ network = json.loads(resp.read())
+ self.assertEquals([], network["vms"])
networks = json.loads(request(host, port, '/networks').read())
self.assertEquals(6, len(networks))
--
1.8.4.2