Modules in the tests package for testing API resources in certain namespaces (e.g. test_transfer_api.py', 'test_offer_api.py') repeat similar code for functions which use a session client to send a request and return a response -- functions usually named something like create_()', get_<entity>_data(), etc.. For example in test_transfer_api.py, the function get_transfer_data().
Because resources are designed such that request data (if any) is expected to always be JSON, the implementation of these functions are (usually) virtually identical.
So I think they should be consolidated somewhere in utils sub-package of the tests package.
Modules in the
testspackage for testing API resources in certain namespaces (e.g.test_transfer_api.py', 'test_offer_api.py') repeat similar code for functions which use a session client to send a request and return a response -- functions usually named something likecreate_()',get_<entity>_data(), etc.. For example intest_transfer_api.py, the functionget_transfer_data().Because resources are designed such that request data (if any) is expected to always be JSON, the implementation of these functions are (usually) virtually identical.
So I think they should be consolidated somewhere in
utilssub-package of thetestspackage.