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

Add callbacks for ftp downloads #150

Merged
merged 3 commits into from
Apr 8, 2024
Merged

Conversation

samaloney
Copy link
Contributor

#127 didn't add the callback for ftp downloads this PR adds them.

@samaloney samaloney marked this pull request as ready for review April 4, 2024 16:21
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.51%. Comparing base (3b049c5) to head (2094a0a).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   90.23%   90.51%   +0.28%     
==========================================
  Files           5        5              
  Lines         635      654      +19     
==========================================
+ Hits          573      592      +19     
  Misses         62       62              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samaloney samaloney force-pushed the feat-ftp-callbacks branch 3 times, most recently from 574a903 to 591bec0 Compare April 5, 2024 10:40
@Cadair
Copy link
Owner

Cadair commented Apr 6, 2024

Thanks a lot @samaloney 🚀

The windows test fail seems real?

@samaloney
Copy link
Contributor Author

samaloney commented Apr 7, 2024

Yea I assumed since it didn't have the @pytest.mark.allow_hosts(True) decorator it wouldn't be able to download but it seem like it can. I can either mock something from aioftp to raise an error or make up a non-existent ftp url so it will fail?

httpserver.serve_content(
"SIMPLE = T", headers={"Content-Disposition": "attachment; filename=testfile.fits"}
)

def done_callback(filepath, url, error):
(Path(gettempdir()) / "callback.done").touch()
cb = MagicMock()
Copy link
Owner

Choose a reason for hiding this comment

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

using magicmock for this is a great idea and one I wish I had thought of lol

@Cadair Cadair merged commit 7c70d4c into Cadair:main Apr 8, 2024
14 checks passed
@Cadair Cadair added the enhancement A new feature or other enhancement to the library label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or other enhancement to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants