<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Reposting this, after discussing with Sean Dague…
<div><br>
</div>
<div>For background, I have developed a REST client lib to talk to a H/W device with REST server for VPNaaS in Neutron. To support unit testing of this, I created a UT module and a mock REST server module and used the
<b>httmock</b> package. I found it easy to use, and was able to easily create a sub-class of my UT to run the same test cases with real H/W, instead of the mock REST server. See the original email below, for links of the UT and REST mock to see how I used it.</div>
<div><br>
</div>
<div><br>
</div>
<div>I created a bug under requirements, to propose adding httmock to the test-requirements. Sean mentioned that there is an existing mock package, called
<b>httpretty</b>, which I found is used in keystone client UTs), and should petition to see if httmock should replace httpretty, since the two appear to overlap in functionality.</div>
<div><br>
</div>
<div>I found this link, with a brief comparison of the two: <a href="http://marekbrzoska.wordpress.com/2013/08/28/mocking-http-requests-in-python/">http://marekbrzoska.wordpress.com/2013/08/28/mocking-http-requests-in-python/</a></div>
<div><br>
</div>
<div>So… I’m wondering if the community is interested in adopting this package (with the goal of deprecating the httpretty package). Otherwise, I will work on reworking the UT code I have to try to use httpretty.</div>
<div><br>
</div>
<div>Would be interested in peoples’ thoughts, especially those who have worked with httpretty.</div>
<div><br>
</div>
<div>Thanks in advance!</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div apple-content-edited="true">
<div>
<div>PCM (Paul Michali)</div>
<div><br>
</div>
<div>MAIL …..…. <a href="mailto:pcm@cisco.com">pcm@cisco.com</a></div>
<div>IRC ……..… pcm_ (<a href="http://irc.freenode.com">irc.freenode.com</a>)</div>
<div>TW ………... @pmichali</div>
<div>GPG Key … 4525ECC253E31A83</div>
<div>Fingerprint .. 307A 96BB 1A4C D2C7 931D 8D2D 4525 ECC2 53E3 1A83</div>
</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
<div>
<div>On Apr 4, 2014, at 10:44 AM, Paul Michali (pcm) <<a href="mailto:pcm@cisco.com">pcm@cisco.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
I’d like to get this added to the test-requirements for Neutron. It is a very flexible HTTP mock module that works with the Requests package. It is a decorator that wraps the Request’s send() method and allows easy mocking of responses, etc (w/o using a web
server).
<div><br>
</div>
<div>The bug is: <a href="https://bugs.launchpad.net/neutron/+bug/1282855">https://bugs.launchpad.net/neutron/+bug/1282855</a></div>
<div><br>
</div>
<div>Initially I had requested both httmock and newer requests, but was requested to separate them, so this is to target httmock as it is more important (to me :) to get approval,</div>
<div><br>
</div>
<div><br>
</div>
<div>The review request is: <a href="https://review.openstack.org/#/c/75296/">https://review.openstack.org/#/c/75296/</a></div>
<div><font face="Monaco"><span style="font-size: 11px;"><br>
</span></font></div>
<div><font face="Monaco"><span style="font-size: 11px;">An example of code that would use this:</span></font></div>
<div><font face="Monaco"><span style="font-size: 11px;"><br>
</span></font></div>
<div><a href="https://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/vpn/device_drivers/notest_cisco_csr_rest.py">https://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/vpn/device_drivers/notest_cisco_csr_rest.py</a></div>
<div><a href="https://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/vpn/device_drivers/cisco_csr_mock.py">https://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/vpn/device_drivers/cisco_csr_mock.py</a></div>
<div><br>
</div>
<div>Looking forward to hearing whether or not we can include this package into Juno.</div>
<div><br>
</div>
<div>Thanks in advance!</div>
<div><br>
</div>
<div><font face="Monaco"><span style="font-size: 11px;"><br>
</span></font>
<div apple-content-edited="true">
<div>
<div>PCM (Paul Michali)</div>
<div><br>
</div>
<div>MAIL …..…. <a href="mailto:pcm@cisco.com">pcm@cisco.com</a></div>
<div>IRC ……..… pcm_ (<a href="http://irc.freenode.com/">irc.freenode.com</a>)</div>
<div>TW ………... @pmichali</div>
<div>GPG Key … 4525ECC253E31A83</div>
<div>Fingerprint .. 307A 96BB 1A4C D2C7 931D 8D2D 4525 ECC2 53E3 1A83</div>
</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
</div>
</div>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br>
</blockquote>
</div>
<br>
</div>
</body>
</html>