Centralize webapi tests' mimetypes and URL lookups.

Review Request #4522 — Created Sept. 2, 2013 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Centralize webapi tests' mimetypes and URL lookups.

The work to split up the webapi test suite had an issue where unit test
classes were being executed multiple times in a test suite run. This
happened because test*.py files were importing classes from other
test*.py files, and nose was finding them. These needed to be imported
in order to get the mimetypes and URLs from those test classes.

This change solves this problem by introducing webapi/tests/mimetypes.py
and webapi/tests/urls.py. mimetypes.py contains the full list of all
expected mimetypes found throughout the test suite. urls.py contains
functions for fetching all the URLs for all resources.

As an aid to urls.py, WebAPIResource now includes functions for
computing the URLs. The ones in urls.py just wrap them to make the
lookups more convenient for the purpose of tests.

Unit tests pass.

    Loading...