Skip to content

Add tests for response model #74

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

Merged
merged 7 commits into from
Jan 27, 2022
Merged

Conversation

J0
Copy link
Contributor

@J0 J0 commented Jan 15, 2022

Add tests to #64

@codecov
Copy link

codecov bot commented Jan 15, 2022

Codecov Report

Merging #74 (c79914d) into add-response-model (54ade70) will increase coverage by 4.40%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           add-response-model      #74      +/-   ##
======================================================
+ Coverage               85.63%   90.04%   +4.40%     
======================================================
  Files                      22       22              
  Lines                     738      864     +126     
======================================================
+ Hits                      632      778     +146     
+ Misses                    106       86      -20     
Impacted Files Coverage Δ
postgrest_py/base_request_builder.py 76.04% <100.00%> (+11.97%) ⬆️
tests/_async/test_request_builder.py 100.00% <100.00%> (ø)
tests/_sync/test_request_builder.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54ade70...c79914d. Read the comment docs.

@dreinon dreinon force-pushed the add-response-model-tests branch from 2f632c6 to 2252051 Compare January 27, 2022 13:31
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 27, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.38%.

Quality metrics Before After Change
Complexity 0.48 ⭐ 0.35 ⭐ -0.13 👍
Method Length 27.75 ⭐ 23.56 ⭐ -4.19 👍
Working memory 5.00 ⭐ 4.73 ⭐ -0.27 👍
Quality 90.47% 91.85% 1.38% 👍
Other metrics Before After Change
Lines 396 714 318
Changed files Quality Before Quality After Quality Change
postgrest_py/base_request_builder.py 88.80% ⭐ 88.79% ⭐ -0.01% 👎
tests/_async/test_request_builder.py 92.64% ⭐ 93.99% ⭐ 1.35% 👍
tests/_sync/test_request_builder.py 92.64% ⭐ 93.99% ⭐ 1.35% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
tests/_async/test_request_builder.py request_response_with_data 0 ⭐ 31 ⭐ 10 😞 79.58% ⭐ Extract out complex expressions
tests/_sync/test_request_builder.py request_response_with_data 0 ⭐ 31 ⭐ 10 😞 79.58% ⭐ Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@dreinon dreinon marked this pull request as ready for review January 27, 2022 23:00
@dreinon dreinon changed the title [WIP]: Add tests for response model Add tests for response model Jan 27, 2022
@dreinon dreinon merged commit 6233ae7 into add-response-model Jan 27, 2022
@dreinon dreinon deleted the add-response-model-tests branch January 27, 2022 23:00
dreinon pushed a commit that referenced this pull request Jan 27, 2022
* initial commit

* tests: add fixtures for APIResponse

* tests: [WIP] Test methods that don't interact with RequestResponse

* tests: replace builtin type by typing type and add type annotations

* tests: add requests Response fixtures

* chore: change return order to improve readability

* tests: add tests for left methods

Co-authored-by: Joel Lee <[email protected]>
Co-authored-by: Dani Reinón <[email protected]>
dreinon added a commit that referenced this pull request Jan 28, 2022
* add poetry dependency

* create APIResponse model

* return APIResponse model in execute method

* sort imports

* mypy bug workaround (python/mypy#9319)

* split logic, validate error existance and better type APIResponse

* Implement APIError

* add missing black config in pre-commit config

* type APIError properties

* fix: rm unused code and use returning param in update

* refactor: reorder lines

* chore: rebuild sync

* chore: rebuild poetry.lock

* fix: remove wrong parameter

* chore: format

* Chore: add missing return types

Co-authored-by: Anand <[email protected]>

* chore: replace builtin dict by Dict to support python < 3.9

* chore: update precommit hooks

* chore: apply format

* update return type in execute method

* use relative import

* add link to mypy issue

* switch super init by class init to avoid future errors

* chore: apply future annotations notation to return

* chore: rebuild sync

* tests: Add tests for response model (#74)

* initial commit

* tests: add fixtures for APIResponse

* tests: [WIP] Test methods that don't interact with RequestResponse

* tests: replace builtin type by typing type and add type annotations

* tests: add requests Response fixtures

* chore: change return order to improve readability

* tests: add tests for left methods

Co-authored-by: Joel Lee <[email protected]>
Co-authored-by: Dani Reinón <[email protected]>

* chore: modify ValueError with ValidationError

* chore: add "_" to internal methods

Co-authored-by: Anand <[email protected]>
Co-authored-by: Lee Yi Jie Joel <[email protected]>
Co-authored-by: Joel Lee <[email protected]>
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.

2 participants