obs_decam - modernize Butler API use in testGetId #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This test was failing because of a sequence of
events:
The test was passing into Butler init an
instantiated mapper passed in but not comparing
equal with the mapper loaded by the repository
cfg.
A repositoryCfg.yaml was being created by the old
use of the Butler API (because the old API creates
a read-write output repository), and it was not
geting cleaned up by the test.
When the test runs again on the same computer
where the old repositoryCfg.yaml file exists, the
mapper is reinstantiated as described by the
repositoryCfg file.
The passed-in instantiated mapper and the
reinstantiated mapper do not compare equal,
becuase they do not implement the eq method
and they are not the same instance.
Butler interprets this as the mapper from the cfg
and the passed-in mapper do not match, and it
raises an exception.
The better fix is to not pass an instantiated
mapper to Butler init, instead pass the class
object and let Butler init the mapper.