axione-elig-test/elig-test.py
Félix Baylac-Jacqué 8c4c540fb8
Add response parser
This parser is not extensively tested yet. We need to generate more
test cases to make sure we're not falling in any of the numerous
Python traps.

We basically retrieve the data for:

- The FTTH lines.
- The stairs reference for each line.
- The building reference/status for each stairs.
2021-10-17 22:30:42 +02:00

22 lines
689 B
Python

import os
from axione_api.api import query_axione_pto
from axione_api.config import parse_config
if __name__ == '__main__':
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")
if resp != None:
respTree = ET.fromstring(resp)