-
Notifications
You must be signed in to change notification settings - Fork 147
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
Enhance: Introducing tests #269
Conversation
Initialized tests (for pytest runner). Initialized tests for `BasePixivAPI`. Add test case for `request_call` of `BasePixivAPI` using GET HTTP-method.
Add tests for different HTTP-methods for `request_call` of `BasePixivAPI` class. Add tests for `additional_headers()`, `parse_json()` methods.
Add utils for reading fixtures data from files. Add fixtures containing common valid JSON data and invalid JSON data.
Add tests for `download()` method of `BasePixivAPI` class.
Add workflow job for running tests with pytest. Add configfile for pytest (pytest.ini).
Update extra dependencies order in setup.cfg. Update imports order in tests/utils.py.
Fix linter issue (redundant new lines) in setup.cfg, tests/utils.py.
inb4:
|
Before continue covering by tests i'd like to open PR at this point to consider your comments and suggestions. And if everything ok i'm up to merge that. |
Good job! I had also thought about introducing tests, but considering the need for a showcase for API, I just used Introducing pytest is great, but I don't have much practical experience in this area. You can refer to the best practices of pytest, or wait for others reviews to take a look. (@Xdynix ) In addition, for the actual unit test part, it is recommended to use data-driven testing (or table-driven testing), make it easy to add test cases later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Please squash the commits when merging to keep the git log clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for review guys! @upbit should i squash the commits by myself (with |
Actually, it's not necessary. Before merging MR to master, just choose |
@upbit sorry for disturbing you again, could you please hit "Squash and merge" if this PR looks OK in your opinion at current stage? Cause i can't merge the PR since i don't have write access to the repo. And then i'd continue to enhance test coverage, in other PR's (i'd suggest to make one PR per test case/test suite). |
Merged |
I'd like to keep it as a draft for a while if you don't mind.
I appreciate if you share any proposal or feedback regarding tests for further updates in the scope of this PR.