Skip to content

Conversation

mutt0-ds
Copy link
Contributor

@mutt0-ds mutt0-ds commented Dec 10, 2022

Hello! I added some tests for the errors and fixed a couple of minor issues (TESTING_PAGE_NAME became a session fixture, I excluded abstract properties from tests and I used "with" statements to test the enter and exit properties of the Client class).

When testing the errors I used https://httpstat.us/ for simulating HTTP errors, let me know if this solution would be OK as I didn't manage to generate this kind of situation with cassettes only. :)

This closes #8 😎

@codecov
Copy link

codecov bot commented Dec 10, 2022

Codecov Report

Base: 91.91% // Head: 100.00% // Increases project coverage by +8.08% 🎉

Coverage data is based on head (94e4f59) compared to base (d5e914a).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #168      +/-   ##
===========================================
+ Coverage   91.91%   100.00%   +8.08%     
===========================================
  Files           7         7              
  Lines         297       290       -7     
===========================================
+ Hits          273       290      +17     
+ Misses         24         0      -24     
Impacted Files Coverage Δ
notion_client/api_endpoints.py 100.00% <ø> (+3.22%) ⬆️
notion_client/helpers.py 100.00% <0.00%> (+1.92%) ⬆️
notion_client/errors.py 100.00% <0.00%> (+5.88%) ⬆️
notion_client/client.py 100.00% <0.00%> (+15.38%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@ramnes ramnes left a comment

Choose a reason for hiding this comment

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

Curious about a few things but that's awesome we're getting there!

@mutt0-ds
Copy link
Contributor Author

So, I applied the minor tweaks but I am not 100% happy with the timeout test, as you can see a Github action failed for a connection issue (I guess)...

@ramnes
Copy link
Owner

ramnes commented Dec 12, 2022

Yep, I just ran the actions again and it does look flaky, not sure why. I'd say that's probably a good place for a mock?

@mutt0-ds
Copy link
Contributor Author

I simulated a timeout with monkeypatch raising a TimeoutException, this should do the trick. Codecov doesn't look too happy but from the errors it looks like a token issue

@ramnes ramnes merged commit d28e906 into ramnes:main Dec 12, 2022
@ramnes
Copy link
Owner

ramnes commented Dec 12, 2022

Thank you once again @mutt0-ds, it's merged! 🎉

@mutt0-ds
Copy link
Contributor Author

It's been a pleasure @ramnes, I've learned so much by working at your project! Let me know if I can contribute to other things :)

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.

100% coverage
2 participants