NetApp ESeries unit test breaks tests using python-requests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
Navneet |
Bug Description
The unit test for the NetApp E-Series volume driver (cinder/
By assigning a mock object to requests.Session during setup and not restoring the original during teardown, the test causes any following code trying to invoke requests.
AttributeError: type object 'FakeEseriesHTT
Attached is a test case (test_requests_
cinder$ ./run_tests.sh -V cinder.
[...]
Ran 1 test in 5.007s
OK
cinder$ ./run_tests.sh -V cinder.
[...]
AttributeError: type object 'FakeEseriesHTT
Ran 15 tests in 5.030s
FAILED (failures=1)
Changed in cinder: | |
assignee: | nobody → Navneet (singn) |
tags: | added: icehouse-backport-potential |
Changed in cinder: | |
milestone: | none → juno-rc2 |
Changed in cinder: | |
importance: | Undecided → Medium |
Changed in cinder: | |
milestone: | juno-rc2 → 2014.2 |
A possible fix is to backup the original requests.Sessions instance on setup and to add a cleanup that restores it after test execution (see attachment).