I have been adding new unit tests for some (not all) new functions/methods in the big PR.
Some of these tests are more complicated than usual. For example, tests of g.findAnyUnl require that the @data unl-path-prefixes setting refers to actual files.
The details are a bit messy, so I defined two new helpers:
- TestGlobals._patch_at_data_unl_path_prefixes and
- LeoUnitTest._set_setting.
The first calls the second. These helpers are themselves a new pattern for me.
The second new pattern defines unit tests for the helpers:
- LeoUnitTest.test_set_setting and
- TestGlobals.test_patch_at_data_unl_path_prefixes.
Summary
g.findAnyUnl assumes that @data unl-path-prefixes is functional. Setting up this condition is more complicated than usual.
One new helper helps simulate the @data unl-path-prefixes setting.
The other new helper helps the helper :-)
New unit tests test both helpers.
Edward
g.findAnyUnl assumes that @data unl-path-prefixes is functional. Setting up this condition is more complicated than usual.
One new helper helps simulate the @data unl-path-prefixes setting.
The other new helper helps the helper :-)
New unit tests test both helpers.