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

Fix dispatcher destination url creation and revert test config to intended value #113

Merged
merged 2 commits into from
Mar 2, 2022

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Mar 2, 2022

Some functionality was accidently removed during the last refactoring, not allowing eg a directory to be provided in the dispatcher config for each config item but not providing any default. This PR fixes it, and uses the correct yaml test config for testing this.

  • Tests fixed

@mraspaud mraspaud added the bug label Mar 2, 2022
@mraspaud mraspaud self-assigned this Mar 2, 2022
@mraspaud mraspaud requested a review from pnuu as a code owner March 2, 2022 10:29
@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #113 (cf71d85) into main (62bf60a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #113   +/-   ##
=======================================
  Coverage   75.68%   75.69%           
=======================================
  Files          18       18           
  Lines        3784     3785    +1     
=======================================
+ Hits         2864     2865    +1     
  Misses        920      920           
Flag Coverage Δ
unittests 75.69% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
trollmoves/dispatcher.py 91.35% <100.00%> (+0.03%) ⬆️
trollmoves/tests/test_dispatcher.py 98.95% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62bf60a...cf71d85. Read the comment docs.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one comment.

@@ -390,14 +390,17 @@ def create_dest_url(self, msg, client, conf):
"""Create the destination URL and the connection parameters."""
defaults = self.config[client].copy()
_verify_filepattern(defaults, msg)
connection_parameters = conf.get('connection_parameters', defaults.get('connection_parameters'))
host = conf.get('host', defaults['host'])
conf_with_defaults = defaults.copy()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this copy is unnecessary. Yes, it makes the naming more clear, but still unnecessary copy since defaults is not used after this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, would you be ok with this?

Suggested change
conf_with_defaults = defaults.copy()
conf_with_defaults = defaults

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, or rename defaults to something more generic as configuration so the extra variable isn't needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable renamed

@mraspaud mraspaud merged commit 9ff030a into pytroll:main Mar 2, 2022
@mraspaud mraspaud deleted the fix-directory-in-config branch March 2, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants