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 a bug where result urls were not updated in retry #153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samaloney
Copy link
Contributor

@samaloney samaloney commented Apr 8, 2024

This is actually what prompted #152 but I forgot to implement this basic version after creating the issue, my bad.

@@ -56,7 +56,7 @@ def default_request_handler(self, environ, start_response):
status = "200 OK"
response_headers = [
("Content-type", "text/plain"),
("Content-Disposition", "attachment; filename=testfile_{self.request_number}.txt"),
("Content-Disposition", f"attachment; filename=testfile_{self.request_number}.txt"),
Copy link
Contributor Author

@samaloney samaloney Apr 8, 2024

Choose a reason for hiding this comment

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

I assume this was supposed to be an f-string originally? Also useful in the updated test

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.64%. Comparing base (3b049c5) to head (dae981b).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
+ Coverage   90.23%   90.64%   +0.41%     
==========================================
  Files           5        5              
  Lines         635      663      +28     
==========================================
+ Hits          573      601      +28     
  Misses         62       62              

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

assert ["0", "1", "3", "4", "2"] == [url[-1] for url in f2.urls]
assert "testfile_1.txt" == f2[0].split("/")[-1]
# there are two requests made per file one for size and one download?
# Todo change handler to use path to create name not request call count
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could either create a different test server or update to the current callback to generate the filename based on the request PATH so like filename=f'testfile_{environ['PATH']}.txt'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant