]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Rework and enable VPNaaS UT for Cisco CSR REST
authorPaul Michali <pcm@cisco.com>
Tue, 16 Sep 2014 15:22:17 +0000 (11:22 -0400)
committerPaul Michali <pcm@cisco.com>
Thu, 18 Sep 2014 13:46:59 +0000 (13:46 +0000)
commit2286d220ddb2677c957837381e1827bdfe3b0c8e
tree44074d7cfd5e0f1bfcb204def8581fa992816201
parente31861c15bc73e65a7c22212df2a56f9e45aa0e4
Rework and enable VPNaaS UT for Cisco CSR REST

The Cisco CSR REST client library unit tests were developed in
Icehouse, using the httmock library. However, the community did
not want to add this library to global requirements, as there was
a similar httpretty library available (albeit with some short-
comings). As a result, the test module was renamed with a "no"
prefix, to prevent inclusion in automated tests.

Since then, a new library, requests-mock, has been added to global
requirements, to replace httpretty, and is being used on several
other projects.

This commit reworks the unit test to use requests-mock, instead of
httmock. The functionality is the same, but the mechanism (a
fixture with URI registration vs context manager) is different.

This commit provides coverage for the REST client code, by using a
mock for the Cisco CSR VM. The unit test module can be subclassed,
and used with a real CSR VM, for 3rd party CI testing, in the
future.

Change-Id: I55c8a253eb32985bc2016ae748b1ded58d021e1a
Closes-Bug: 1358470
neutron/tests/unit/services/vpn/device_drivers/cisco_csr_mock.py [deleted file]
neutron/tests/unit/services/vpn/device_drivers/notest_cisco_csr_rest.py [deleted file]
neutron/tests/unit/services/vpn/device_drivers/test_cisco_csr_rest.py [new file with mode: 0644]