[openstack-dev] [neutron] Need community weigh-in on requests-mock

Paul Michali (pcm) pcm at cisco.com
Fri Aug 22 18:50:10 UTC 2014


Hi! Need to get the community to weigh in on this…

In Neutron there currently is no mock library for the Requests package. During Icehouse, I created unit tests that used the httmock package (a context-library based Requests mock). However, the community did not want me to add this to global requirements, because there was httpretty (a URL registration based mock) already approved for use (but not in Neutron). As a result, I disabled the UTs (renaming the module to have a “no” prefix).

Instead of modifying the UT to work with httpretty, and requesting that httpretty be added to Neutron test-requirements, I waited, as there was discussion on replacing httpretty.

Fast forward to now, and there is a new requests-mock package that has been implemented, added to global requirements, and is being used in keystone client and nova client projects.  My goal is to make use of the new mock library, as it has become the library of choice.

I have migrated my UT to use the requests-mock package, and would like to gain approval to add requests-mock to Neutron. I have two commits out for review. The first, https://review.openstack.org/#/c/115107/, is to add requests-mock to test-requirements for Neutron. The second,https://review.openstack.org/#/c/116018/, has the UT module reworked to use requests-mock, AND includes the addition of requests-mock to test-requirements (so that there is one commit showing the use of this new library - originally, I had just the UT, but there was a request to join the two changes).

Community questions:

Is it OK to add requests-mock to Neutron test-requirements?
If so, would you rather see this done as two commits (one for the package, one for the UT), or one combined commit?

Cores, you can “vote/comment” in the reviews, so that I can proceed in the right direction.

Thanks for your consideration!


PCM (Paul Michali)

MAIL …..…. pcm at cisco.com
IRC ……..… pcm_ (irc.freenode.com)
TW ………... @pmichali
GPG Key … 4525ECC253E31A83
Fingerprint .. 307A 96BB 1A4C D2C7 931D 8D2D 4525 ECC2 53E3 1A83



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140822/cf23c4bc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140822/cf23c4bc/attachment.pgp>


More information about the OpenStack-dev mailing list