Merge "Correctly mock keystoneclient.Client.auto_token property with Mox"

This commit is contained in:
Jenkins 2013-02-27 01:30:02 +00:00 committed by Gerrit Code Review
commit 8dd26aacb8
1 changed files with 3 additions and 0 deletions

View File

@ -277,6 +277,9 @@ class APITestCase(TestCase):
def stub_keystoneclient(self):
if not hasattr(self, "keystoneclient"):
self.mox.StubOutWithMock(keystone_client, 'Client')
# NOTE(saschpe): Mock the 'auth_token' property specifically,
# MockObject.__init__ ignores properties altogether:
keystone_client.Client.auth_token = 'foo'
self.keystoneclient = self.mox.CreateMock(keystone_client.Client)
return self.keystoneclient