Remove duplicated tests code in Glance tests

Registered by Alexander Gordeev

Lots of code in glance tests is duplicated.
This blueprint is a summary list of problem places that needs to be worked on

We should create separate classes for different methods tests to improve tests setUp code.
Tests should be refactored to remove duplicated code and improve test assertions.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Alexander Gordeev
Direction:
Approved
Assignee:
Alexander Gordeev
Definition:
New
Series goal:
None
Implementation:
Implemented
Milestone target:
milestone icon ongoing
Started by
Alexander Gordeev
Completed by
Mark Washenberger

Related branches

Sprints

Whiteboard

Currently this tests have following problems:
1) Different tests use different methods to setup fixtures and stubs
2) A lot of setup code is duplicated
3) Test classes a too big and should be separated in smaller ones
4) Some tests assertions are quite bad and not actually asserting anything
5) some test code can be organized a little bit to create simple DSL like methods to help understand main test goal

more detailed description:
   improve fixture reusage:
     glance/tests/unit/v1/test_api.py
     glance/tests/unit/v1/test_registry_api.py
     glance/tests/unit/v1/test_registry_client.py
     glance/tests/unit/v2/test_registry_api.py
     glance/tests/unit/v2/test_registry_client.py

Gerrit topic: https://review.openstack.org/#q,topic:bp/glance-tests-code-duplication,n,z

Addressed by: https://review.openstack.org/36638
    Refactor glance/tests/unit/v1/test_registry_api.py

Addressed by: https://review.openstack.org/36666
    Refactor glance/tests/unit/v1/test_api.py

Addressed by: https://review.openstack.org/37409
    Refactor glance/tests/unit/v2/test_registry_client.py

Addressed by: https://review.openstack.org/37420
    Refactor glance/tests/unit/v1/test_registry_client.py

Addressed by: https://review.openstack.org/37438
    Refactor glance/tests/unit/v2/test_registry_api.py

Addressed by: https://review.openstack.org/37680
    Improve test/utils.py

Addressed by: https://review.openstack.org/38139
    Code dedup in glance/tests/unit/v1/test_registry_api.py

Looks like this is complete, please update implementation status if it is not.

Addressed by: https://review.openstack.org/89614
    Improve test/utils.py

Addressed by: https://review.openstack.org/89615
    Refactor glance/tests/unit/v2/test_registry_client.py

(?)

Work Items

Work items:
[a-gordeev] glance/tests/unit/v1/test_api.py: INPROGRESS
[eezhova] glance/tests/unit/v1/test_registry_api.py: DONE
[a-gordeev] glance/tests/unit/v2/test_registry_client.py: INPROGRESS
[a-gordeev] glance/tests/unit/v1/test_registry_client.py: INPROGRESS
[a-gordeev] glance/tests/unit/v2/test_registry_api.py: INPROGRESS

This blueprint contains Public information 
Everyone can see this information.