axione-elig-test/elig-test.py

23 lines
695 B
Python
Raw Permalink Normal View History

2021-10-17 18:16:29 +02:00
import os
from axione_api.api import query_axione_pto, parse_response
2021-10-17 18:16:29 +02:00
from axione_api.config import parse_config
if __name__ == "__main__":
2021-10-17 18:16:29 +02:00
cfg_path = os.environ.get("CONFIG", "/etc/axione-elig-test.ini")
print(f'Reading the "{cfg_path}" config file')
cfg = parse_config(cfg_path)
cfg.debug = True if "DEBUG" in os.environ else False
if cfg.debug:
print("===================")
print("DEBUG_MODE")
print("No requests will be performed")
print("We'll inject some dummy data instead")
print("===================")
print("")
resp = query_axione_pto(cfg, "SPTH-BIEM2-0197")
presp = parse_response(resp)
print(presp)