Stubout cinder.tenant_absolute_limits in cinder test
To render dropdown actions to detail page, allowed() method in the volume table is called, so a method called in allowed() needs to be stubout. Change-Id: Ib65eee0fa2c8b6535e1e391579fcd1bdb0f83bc1 Closes-Bug: #1378907
This commit is contained in:
parent
6f0f18334b
commit
1828eecc85
@ -955,7 +955,7 @@ class VolumeViewTests(test.TestCase):
|
||||
self.assertContains(res, expected_string, html=True,
|
||||
msg_prefix="The create button is not disabled")
|
||||
|
||||
@test.create_stubs({cinder: ('volume_get',),
|
||||
@test.create_stubs({cinder: ('volume_get', 'tenant_absolute_limits'),
|
||||
api.nova: ('server_get',)})
|
||||
def test_detail_view(self):
|
||||
volume = self.cinder_volumes.first()
|
||||
@ -965,6 +965,8 @@ class VolumeViewTests(test.TestCase):
|
||||
|
||||
cinder.volume_get(IsA(http.HttpRequest), volume.id).AndReturn(volume)
|
||||
api.nova.server_get(IsA(http.HttpRequest), server.id).AndReturn(server)
|
||||
cinder.tenant_absolute_limits(IsA(http.HttpRequest))\
|
||||
.AndReturn(self.cinder_limits['absolute'])
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user