Reduce usage of MultipleTimes() in tests

Registered by Tzu-Mainn Chen

Getting rid of .MultipleTimes() in test, it always(90%) point to some ineffective code that needs to be optimized.

Send requests for optimized methods in Tuskar API, when optimization on Ui level is not possible.

Blueprint information

Status:
Complete
Approver:
Tzu-Mainn Chen
Priority:
Undefined
Drafter:
Tzu-Mainn Chen
Direction:
Approved
Assignee:
Tzu-Mainn Chen
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Tzu-Mainn Chen
Completed by
Tzu-Mainn Chen

Related branches

Sprints

Whiteboard

The MultipleTimes in test/api_tests/tuskar_tests.py look legitimate to me; we're iterating over several nodes, and some methods are called multiple times.

There are three in resource_classes/tests.py that I'm not sure how to remove; they're all multiple calls to ResourceClass.get in Edit views, and the first one is in get_initial; the second deep in resource_classes/workflows.py. I'm not sure how the two would be shareable. . . ?
[lsmola] just a thought about that, I have found out that it is perfectly fine to duplicate the code. So duplicate the code for 'get' three times, and put there e.g. a comment 'I am testing that it should be called exactly 3 times'

Gerrit topic: https://review.openstack.org/#q,topic:bp/multiple-times-in-tests,n,z

Addressed by: https://review.openstack.org/45286
    cleaned up instances of MultipleTimes

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.