[openstack-dev] [horizon] mocking policy

Lyle, David david.lyle at hp.com
Tue Jun 10 03:58:07 UTC 2014

I have no problem with this proposal.


On 6/4/14, 6:41 AM, "Radomir Dopieralski" <openstack at sheep.art.pl> wrote:

>I'd like to start a discussion about the use of mocking libraries in
>Horizon's tests, in particular, mox and mock.
>As you may know, Mox is the library that has been used so far, and we
>have a lot of tests written using it. It is based on a similar Java
>library and does very strict checking, although its error reporting may
>leave something more to be desired.
>Mock is a more pythonic library, insluded in the stdlib of recent Python
>versions, but also available as a separate library for older pythons. It
>has a much more relaxed approach, allowing you to only test the things
>that you actually care about and to write tests that don't have to be
>rewritten after each and every refactoring.
>Some OpenStack projects, such as Nova, seem to have adopted an approach
>that favors Mock in newly written tests, but allows use of Mox for older
>tests, or when it's more suitable for the job.
>In Horizon we only use Mox, and Mock is not even in requirements.txt. I
>would like to propose to add Mock to requirements.txt and start using it
>in new tests where it makes more sense than Mox -- in particular, when
>we are writing unit tests only testing small part of the code.
>Radomir Dopieralski
>OpenStack-dev mailing list
>OpenStack-dev at lists.openstack.org

More information about the OpenStack-dev mailing list