Closed albu-diku closed 1 month ago
Merged through svn with the review docstring comment addressed.
Also added the missing copyright header to test_support.py
and fixed the 'configuraed' typo in a comment. Those edits resulted in minor autopep8
adjustments to wrap long lines and tweak white space.
A great deal of code that we wish to exercise under test requires a configuration object. The wiring to generate test configuration values is already in tree, but actually consuming it in tests was done in an ad-hoc fashion. Meanwhile the separate notion of a FakeConfiguration was added primarily to allow exercising code that needs a specific subset of vars set with specific values.
This patch raises this use-case to the level of the common support library. Use the way a logger was exposed as a blueprint and add a configuration property to MigTestCase - this is a computed property that lazily creates a (by default) FakeConfiguration object.
This object persists for the duration of the test. Provide a means for easily overriding this to make it a fully populated Configuration instance using the testconfig - this mechanism is declarative such that the details of configuration loading are transparent to callers. Document this use via an extra test case in the support library tests.