openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #09724
Re: mock, mox, stubs, fakes, etc
Thanks Lorin! That helps me quite a bit.
-joe
On Apr 8, 2012, at 3:20 PM, Lorin Hochstein wrote:
> mox and mock are two competing Python libraries for defining mock objects for unit tests. I think they're basically equivalent in terms of what you can do with them, but they use different styles: In mox the assertions are written before the code under test, and in mock the assertions are written after the code under test.
>
> I personally think mock is more Pythonic, and it's what I use on other projects. Mox is a port of a Java library, and mock was (AFAIK) written specifically for Python. Also, Mock has been accepted into the Python 3.3(?) standard library as a submodule of unit tests. However, mox has been the main mocking library used in Nova unit test for as long as I have been familiar with the code.
>
> Take care,
>
> Lorin
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>
>
>
>
>
> On Apr 8, 2012, at 4:06 PM, Joseph Heck wrote:
>
>> Poking around through all various mechanisms we have to test and verify OpenStack - does anyone have a concise writeup on the various tools and techniques that we're using?
>>
>> I'm not familiar with the "stubs" or "mock" libraries, and a little familiar with mox.
>>
>> Is anyone who is familiar with them all willing to take a stab at outlining where they're individually most effective and useful?
>>
>> -joe
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openstack
>> Post to : openstack@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~openstack
>> More help : https://help.launchpad.net/ListHelp
>
References
-
mock, mox, stubs, fakes, etc
From: Joseph Heck, 2012-04-08
-
Re: mock, mox, stubs, fakes, etc
From: Lorin Hochstein, 2012-04-08