From 7e6dd0064f04f19a48526037dbefd940d51153e5 Mon Sep 17 00:00:00 2001 From: brodokk Date: Mon, 14 Oct 2024 20:56:03 +0200 Subject: [PATCH] Add quick and dirty script to test endpoints --- test.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..2427271 --- /dev/null +++ b/test.py @@ -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= 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']}") +