[openstack-dev] Glance tests failed

Tiantian Gao gtt116 at gmail.com
Thu Aug 8 02:31:10 UTC 2013


Hi stackers,

I found a error after run glance tests. One of them is:

======================================================================
ERROR: glance.tests.unit.test_store_image.TestStoreAddToBackend.test_bad_metadata_not_dict
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/jenkins/workspace/rebase-glance-master/glance/tests/unit/test_store_image.py",
line 788, in test_bad_metadata_not_dict
    store.__str__().AndReturn(('hello'))
AttributeError: 'str' object has no attribute 'AndReturn'

======================================================================

The code around the traceback is:



def _bad_metadata(self, in_metadata):

store = self.mox.CreateMockAnything()
store.add(self.image_id, mox.IgnoreArg(), self.size).AndReturn(
            (self.location, self.size, self.checksum, in_metadata))
store.__str__().AndReturn(('hello'))  <<<< AttributeError here.

self.mox.ReplayAll()

......
self.mox.VerifyAll()


I try these codes in python shell, and raised the same exception.

I inspect the source code of mox, find that  "__str__()" was defined as a
normal method. when we call store.__str__(), it will return a str object.
Of cause str doesn't have 'AndReturn' attribute.

That make me crazy, and what really confuse me is that jenkins is happy
with it.
Did I ignore somethings? Thanks in advance.

-- 
Best regards,
gtt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130808/d920a73d/attachment.html>


More information about the OpenStack-dev mailing list