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

Replace abandoned httplib2, use charset from web server and use mocked http requests #154

Merged

Conversation

DerDreschner
Copy link
Contributor

This pull request makes a few changes:

  • httplib2 has been abandoned for ~2 years now, and it looks like it may raise problems with future Python versions. I replace it here with urllib3 to make mocked HTTP requests easy.
  • The charset of a downloaded ICS file can be different from UTF-8 (like in Add encoding parameter to events, etc. #104). Therefore, we should use the charset transmitted by the web server instead of guessing it's UTF-8.
  • The unit tests used real HTTP requests against the master branch here on GitHub so far. This makes testing different cases quite impossible. As I want to see if downloading files with different charsets works, I had to change this. Therefore, I implemented mocked HTTP requests using pock.
  • Implement test cases for Latin-1 ICS files as well as handling empty responses correctly.

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.86%. Comparing base (97493e3) to head (0570410).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #154      +/-   ##
==========================================
+ Coverage   91.31%   91.86%   +0.54%     
==========================================
  Files           4        4              
  Lines         380      381       +1     
  Branches       94       94              
==========================================
+ Hits          347      350       +3     
+ Misses         15       14       -1     
+ Partials       18       17       -1     

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

@DerDreschner DerDreschner changed the title Replace abandoned httplib2, use charset from web server and use mocked http requests instead of real ones in tests Replace abandoned httplib2, use charset from web server and use mocked http requests Jan 17, 2025
@DerDreschner DerDreschner merged commit 4db8471 into jazzband:master Jan 17, 2025
4 checks passed
@DerDreschner DerDreschner deleted the feature/use-encoding-from-webserver branch January 17, 2025 11:06
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.

1 participant