Add support for extension tests involving static media.
Review Request #10821 — Created Jan. 13, 2020 and submitted
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
usedpkg_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.
Summary | ID |
---|---|
cd086720647d519afae6bfcb682d6979927b8269 |
Description | From | Last Updated |
---|---|---|
F841 local variable 'fp' is assigned to but never used |
reviewbot |
- Change Summary:
-
Removed an unused variable.
- Commits:
-
Summary ID cb58c3e6931121c22f90c7f27dee819fbb8557e7 75f5c4b9a1934ccf4cf715fb981fe270e4c59c8f - Diff:
-
Revision 2 (+366 -68)
Checks run (2 succeeded)
- Change Summary:
-
- The test runner now erases and then collects all static media files up-front.
- Fixed a typo in
test_compressed_tags
.
- Commits:
-
Summary ID 75f5c4b9a1934ccf4cf715fb981fe270e4c59c8f cd086720647d519afae6bfcb682d6979927b8269 - Diff:
-
Revision 3 (+380 -68)