You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make FakeConfiguration a representative configuration object.
As of this commit fake configuration instances are populated with
the same properties, including the same default values, as a genuine
Configuration object instance. This ensures that logic under test is
going to behave far more as it would with a real configuration object
which means a great deal more assurance in the tests.
Achieve this by using the dictionary of defaults that was split out
previously to initialize the FakeConfiguration which itself is now
a SimpleNamespace. Making it a namespace ensures that attribute lookup,
something that normal Configuration objects support, work correctly but
in addition forces the attributes to be set "up front". This keeps us
honest in the properties we expose.
Since a FakeConfiguration needs to track the real Configuration we also
prevent the addition of attributes that not keys of a real configuration.
Unfortunarely it seems that a lot of properties are set dynamically as
part of loading a configuration, but laythe first steps to a canonical
configuration object by making a couple of properties used by existing
tests static; existing defaults are re-used to avoid functional change.
0 commit comments