[Kimchi-devel] [PATCH V5 3/3] network improvement: update test case to support vms field
Aline Manera
alinefm at linux.vnet.ibm.com
Thu Jan 9 13:31:02 UTC 2014
Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>
On 01/07/2014 04:50 AM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> update test_rest and test_model
>
> Signed-off-by: ShaoHe Feng <shaohef at 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))
More information about the Kimchi-devel
mailing list