From: Kyle Mestery Date: Fri, 14 Dec 2012 15:00:08 +0000 (+0000) Subject: Update test_router_list to validate the router returned. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=9a442afbfa409a67b619d0f5d59036143407ab4a;p=openstack-build%2Fneutron-build.git Update test_router_list to validate the router returned. For unit test test_l3_plugin.L3NatExtensionTestCase.test_router_list, correctly validate the value returned from listing the routers. Fixes bug 1078150 Change-Id: I5ae559c37f43c1b977065a3508b6efb4375a2c1a --- diff --git a/quantum/tests/unit/test_l3_plugin.py b/quantum/tests/unit/test_l3_plugin.py index f628f733a..c093e674a 100644 --- a/quantum/tests/unit/test_l3_plugin.py +++ b/quantum/tests/unit/test_l3_plugin.py @@ -21,7 +21,7 @@ import contextlib import copy import itertools import logging -import unittest +import unittest2 as unittest import mock from webob import exc @@ -141,6 +141,9 @@ class L3NatExtensionTestCase(unittest.TestCase): instance.get_routers.assert_called_with(mock.ANY, fields=mock.ANY, filters=mock.ANY) self.assertEqual(res.status_int, exc.HTTPOk.code) + self.assertTrue('routers' in res.json) + self.assertEqual(1, len(res.json['routers'])) + self.assertEqual(router_id, res.json['routers'][0]['id']) def test_router_update(self): router_id = _uuid()