Skip to content

Commit

Permalink
Add quick and dirty script to test endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
brodokk committed Oct 14, 2024
1 parent 30628d1 commit 7e6dd00
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test.py
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']}")

0 comments on commit 7e6dd00

Please sign in to comment.