Skip to content

Rework image scaler tests

Matthias Käppler requested to merge mk/rework-image-scaler-tests into master

The image scaler test suite was not very good. It was mostly testing module-private functions, so test coverage was poor and tightly coupled to implementation details. In particular, it did not test the Inject function at all. I also found myself literally unable to test the changes needed to implement conditional GETs, since all that logic fires in Inject.

I therefore decided this is a good time to rewrite this thing.

The tests now go through the same interface the application would use too, i.e. through a Request -> Response roundtrip passed through the Inject function. I folded all tests into that sort of input-output exchange, except for functions that test some of the more fine-grained input verification, which seemed simpler to test at the function level.

To test conditional GETs, we will now be able to pass in header fields such as If-modified-since and assert that the correct response is served.

Edited by Matthias Käppler

Merge request reports