-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add resolve_template
method to EasyConfig
class
#4677
Add resolve_template
method to EasyConfig
class
#4677
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Flamefire Can you look into adding a dedicated test for the resolve_template
method?
I though it was not necessary: The tests for checking the template values already cover this via the getters and a test if So only thing which I'd say is worth checking, is whether the template dict gets initialized first time this gets called to detect easier if it gets removed by some later change, although the other tests would fail already. |
The dict gets initialized by `parse` during `__init__` and hence cannot be empty or unset.
I added a test and tried to trigger the case where |
…_template` method
resolve_template
function to easyconfig instancesresolve_template
method to EasyConfig
class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
(created using
eb --new-pr
)Not only does this reduce the (non-trivial) code duplication, it also allows e.g. easyblocks to resolve a template without setting an EC parameter. e.g.
self.cfg.resolve_template('lib/%(pyshortver)s')
might be useful.