Add support for extension tests involving static media.

Review Request #10821 — Created Jan. 13, 2020 and submitted — Latest diff uploaded

Information

Djblets
release-2.0.x

Reviewers

We have unit tests that involve static media bundles, but they're not
really involving any actual files in those bundles, meaning that certain
logic never gets instrumented.

This change adds the settings and support needed to be able to involve
actual static files in tests. It does this by adding in several static
files (source and bundled, both raw and versioned), so that they can be
looked up through the static media system.

Since we're not using actual extensions backed by a Python package, we
needed to be able to fake results for static media lookups. Internally,
ExtensionManager used pkg_resources methods to perform lookups in
packages to get this information, and spying on those methods was one
possible way of doing this, but instead we're adding methods to
ExtensionInfo for performing these lookups. This abstracts much of the
actual package access away, and gives us a clearer target for spying
(and, down the road, we could make it possible to provide a subclass of
ExtensionInfo more specific for testing purposes).

Some tests had to change in order to test against versioned files.

Unit tests pass on all supported versions of Python.

Commits

Files