Test mocking with requests-mock

Registered by Jamie Lennox on 2014-03-10

The current testing process involves faking out a lot of client code. This has two major problems:
1. A lot of what we are testing is mocking infrastructure rather than actual code.
2. It is very reliant on the current structure of the client.

In general i would like to push towards adopting the keystoneclient session object as the base means of communication, but first we must make the testing process more resilient and less tied to how the client currently works.

Initially this was planned to be done with HTTPretty, however requirements has allowed a new library called requests-mock which is requests library specific but easier to work with.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Jamie Lennox
Direction:
Needs approval
Assignee:
Jamie Lennox
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Sean McGinnis on 2015-10-09

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/httpretty-testing,n,z

Addressed by: https://review.openstack.org/79264
    Convert base HTTP tests to httpretty

Addressed by: https://review.openstack.org/79265
    Convert auth tests to HTTPretty

Addressed by: https://review.openstack.org/79266
    Convert Availability Zone testing to HTTPretty

Addressed by: https://review.openstack.org/79267
    Convert QOS tests to HTTPretty

Addressed by: https://review.openstack.org/79268
    Convert Quota Class Sets testing to HTTPretty

Gerrit topic: https://review.openstack.org/#q,topic:bp/http-mock-testing,n,z

Addressed by: https://review.openstack.org/106665
    Replace httpretty with requests-mock

Addressed by: https://review.openstack.org/106666
    Convert snapshot tests to requests-mock

Addressed by: https://review.openstack.org/106667
    convert availability zone tests to requests-mock

Addressed by: https://review.openstack.org/106668
    Convert qos tests to requests-mock

Addressed by: https://review.openstack.org/106669
    Convert quota tests to requests-mock

Addressed by: https://review.openstack.org/106670
    Convert quota classes tests to requests-mock

Addressed by: https://review.openstack.org/106671
    Convert services tests to requests-mock

Addressed by: https://review.openstack.org/106672
    Convert volume type tests to requests-mock

Addressed by: https://review.openstack.org/106673
    Convert volume backup tests to requests-mock

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.