Add missing mock to test_set_external_network_empty
A missing mock causes test failures when using requests 2.4.0 (I'm uncertain as to why). Add the mock, and change the "expected error messages" assertion down to 1 since only one failure should occur (I assume previously the failure on get_tenant_list caused a 2nd error message to pop up). Change-Id: Icb0110c5937c3d4e437cc708ce8dbb8d0edaae74 Closes-Bug: #1363159
This commit is contained in:
parent
af7559b7e7
commit
f3da51632b
@ -60,12 +60,15 @@ class RouterTests(test.BaseAdminViewTests, r_test.RouterTests):
|
||||
self.assertEqual(len(res.context['table'].data), 0)
|
||||
self.assertMessageCount(res, error=1)
|
||||
|
||||
@test.create_stubs({api.neutron: ('router_list', 'network_list')})
|
||||
@test.create_stubs({api.neutron: ('router_list', 'network_list'),
|
||||
api.keystone: ('tenant_list',)})
|
||||
def test_set_external_network_empty(self):
|
||||
router = self.routers.first()
|
||||
api.neutron.router_list(
|
||||
IsA(http.HttpRequest),
|
||||
search_opts=None).AndReturn([router])
|
||||
api.keystone.tenant_list(IsA(http.HttpRequest))\
|
||||
.AndReturn([self.tenants.list(), False])
|
||||
self._mock_external_network_list(alter_ids=True)
|
||||
self.mox.ReplayAll()
|
||||
|
||||
@ -76,4 +79,4 @@ class RouterTests(test.BaseAdminViewTests, r_test.RouterTests):
|
||||
self.assertIn('(Not Found)',
|
||||
table_data[0]['external_gateway_info']['network'])
|
||||
self.assertTemplateUsed(res, '%s/routers/index.html' % self.DASHBOARD)
|
||||
self.assertMessageCount(res, error=2)
|
||||
self.assertMessageCount(res, error=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user