-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add quick and dirty script to test endpoints
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
Tool to quickly test if the endpoints input and output are still matching with the code. | ||
For not this script have just in mind to detect if some class have field that are missing or of invalid type. | ||
Usage: | ||
OWNERID=<Resonite U- user id> PASSWORD=<your password> python test.py | ||
TODO: Add the ability to show if a field is missing but send by resonite API | ||
""" | ||
|
||
import os | ||
|
||
from resonitepy.client import Client | ||
from resonitepy import classes | ||
|
||
client = Client() | ||
|
||
client.login( | ||
classes.LoginDetails( | ||
ownerId=os.environ.get('OWNERID'), | ||
authentication=classes.LoginDetailsAuth(password=os.environ.get('PASSWORD')), | ||
) | ||
) | ||
|
||
errors = [] | ||
|
||
try: | ||
platform = client.platform() | ||
except Exception as exc: | ||
errors.append( | ||
{ | ||
"class": "Plaform", | ||
"error": str(exc) | ||
} | ||
) | ||
|
||
for error in errors: | ||
print(f"Class {error['class']}") | ||
print(f" {error['error']}") | ||
|