Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs_decam - modernize Butler API use in testGetId #64

Merged
merged 1 commit into from Jul 28, 2017

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Jul 13, 2017

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.

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.
@n8pease n8pease merged commit 2685652 into master Jul 28, 2017
@ktlim ktlim deleted the tickets/DM-11217 branch August 25, 2018 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant