-
Notifications
You must be signed in to change notification settings - Fork 339
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
Raise exception if response from call() is CallError #124
Conversation
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.
You can add a test? I'll come back later to
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.
A test for this is missing, then it is good to go!
I promised some advice when it comes to writing tests for the piece of code you introduced. In [tests/v16/test_v16_charge_point.py] you can add the tests. For the test you can reuse the This test require a call, that is the request, and a call error. The latter is the response. Because of limitations of testing you first need prepare the response. Create an instance of Now you can create the request. You need to instantiate a payload from Note that it's important that the request and response have the same unique id. Otherwise a response can't be matched to a request. I hope this is enough information. If not, let me know. |
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.
The lint job on CircleCI compains. Can you make the job happy?
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.
Thanks!
* If response is a CallError, an exception will be raised instead of being silenced. To maintain backwards compatibility a suppress=True keyword argument was added in ChargePoint.call. * Raise exception if response from call() is CallError * Add tests for handling CallError Co-authored-by: Auke Willem Oosterhoff <[email protected]>
This PR references issue #104 .
If the response is a CallError, an exception will be raised instead of being silenced.
To maintain backwards compatibility a
suppress=True
keyword argument was added inChargepoint.call
.