Skip to content

Add new exception type for when an endpoint isn't available in the current plan - #170

Merged
bachya merged 1 commit into
devfrom
403
Aug 12, 2020
Merged

bachya merged 1 commit into
devfrom
403

Conversation

@bachya

@bachya bachya commented Aug 12, 2020

Copy link
Copy Markdown
Owner

Describe what the PR does:

This PR adds a new exception type (EndpointUnavailable) that gets raised when the user attempts to call an endpoint that isn't available in their plan.

Does this fix a specific issue?

N/A

Checklist:

  • Confirm that one or more new tests are written for the new functionality.
  • Run tests and ensure everything passes (with 100% test coverage).
  • Update README.md and docs/ with any new documentation.
  • Add yourself to AUTHORS.md.

@bachya bachya added the enhancement Enhancement of the code, not introducing new features. label Aug 12, 2020
@bachya bachya self-assigned this Aug 12, 2020
@sourcery-ai

sourcery-ai Bot commented Aug 12, 2020

Copy link
Copy Markdown

Sourcery Code Quality Report (beta)

❌  Merging this PR will decrease code quality in the affected files by 0.01 out of 10.

Quality metrics Before After Change
Complexity 0.54 0.52 -0.02 🔵
Method Length 85.97 86.42 0.45 🔴
Quality 8.08 8.07 -0.01 🔴
Other metrics Before After Change
Lines 1400 1407 7
Changed files Quality Before Quality After Quality Change
simplipy/api.py 8.58 8.58 0.00
simplipy/errors.py 9.35 9.26 -0.09 🔴
tests/test_api.py 8.23 8.17 -0.06 🔴
tests/system/test_v3.py 7.69 7.71 0.02 🔵

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

File Function Complexity Length Overall Recommendation
simplipy/api.py API.request 21 251.69 3.76 Split out functionality
tests/system/test_v3.py test_properties 0 337.23 5.33 Split out functionality
tests/system/test_v3.py test_get_systems 0 211.70 6.07 Split out functionality
tests/system/test_v3.py test_set_states 0 166.76 6.59 Split out functionality
tests/system/test_v3.py test_set_pin 0 150.74 6.81 Split out functionality

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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@codecov

codecov Bot commented Aug 12, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #170 into dev will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #170   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          581       583    +2     
=========================================
+ Hits           581       583    +2     
Impacted Files Coverage Δ
simplipy/api.py 100.00% <100.00%> (ø)
simplipy/errors.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 4a3e9d4...2567ad8. Read the comment docs.

@qlty-cloud-legacy

Copy link
Copy Markdown

Code Climate has analyzed commit 2567ad8 and detected 0 issues on this pull request.

View more on Code Climate.

@bachya
bachya merged commit 5dfd1c7 into dev Aug 12, 2020
@bachya
bachya deleted the 403 branch August 12, 2020 20:31
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement Enhancement of the code, not introducing new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant