Skip to content
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

Add unit test for credit exceedance #22

Open
stijnvanhoey opened this issue Dec 8, 2020 · 0 comments
Open

Add unit test for credit exceedance #22

stijnvanhoey opened this issue Dec 8, 2020 · 0 comments
Assignees

Comments

@stijnvanhoey
Copy link
Contributor

For the VMM-case, we are allowed to use the test token with 0 credits for testing purposes:

test_0 hast 0 credits/day and should result in an error on the second call (the first call will exceed the allowance): YWNjNmFjOWYtZmVhNS00MmM5LWE4MWItZjZiMTk4NWE5ZGFjOmUzNWFjMjllLWIzMDQtNDY3My1iMGNjLWUyMTg0MmRjMDk2Mg==
However, it does take some time for the system to recognize that a token is exhausted and even the token with 0 credits may work for some period of time after a first call has been made before errors start being returned.

So the following example makes fails by the second call:

from pywaterinfo import Waterinfo
vmm = Waterinfo("vmm", token="YWNjNmFjOWYtZmVhNS00MmM5LWE4MWItZjZiMTk4NWE5ZGFjOmUzNWFjMjllLWIzMDQtNDY3My1iMGNjLWUyMTg0MmRjMDk2Mg==")
vmm.get_timeseries_value_layer(timeseriesgroup_id="192786")
vmm.get_timeseries_value_layer(timeseriesgroup_id="192894")

Error message:

KiwisException: Waterinfo call returned 429 errorwith the message b'<?xml version="1.0" ?><ExceptionReport><Exception exceptionCode="AuthCreditLimit"><ExceptionText>Credit limit exceeded for type TOKEN and key acc6ac9f-fea5-42c9-a81b-f6b1985a9dac</ExceptionText></Exception></ExceptionReport>'
@stijnvanhoey stijnvanhoey self-assigned this Dec 8, 2020
@stijnvanhoey stijnvanhoey changed the title Add test for credit exceedance Add unit test for credit exceedance Dec 8, 2020
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

No branches or pull requests

1 participant