diff --git a/.gitignore b/.gitignore index ba25e1a..677a44d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ test.py .vscode +*.venv tests/credentials.json dist *.egg-info diff --git a/tests/test_client.py b/tests/test_client.py index 6d3681f..bd2333d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -117,13 +117,13 @@ def test_get_battery_stats(self): plant_ids = client.get_plant_ids() # get the stats - stats = client.get_plant_flow(plant_ids[0]) + battery_ids = client.get_battery_ids(plant_id=plant_ids[0]) - battery_stats = stats['data']['flow']['nodes'][4]['deviceTips'] - battery_id = stats['data']['flow']['nodes'][4]["devIds"][0] + # to enable tests on systems without batteries + if len(battery_ids) < 1: + return - self.assertIsInstance(battery_stats, dict) - self.assertIsNotNone(battery_id) + battery_id = battery_ids[0] battery_day_stats = client.get_battery_day_stats(battery_id) diff --git a/tests/test_onnx.py b/tests/test_onnx.py index 23f913b..33aa63f 100644 --- a/tests/test_onnx.py +++ b/tests/test_onnx.py @@ -1,8 +1,12 @@ import cv2 import os - +import sys import unittest +currentdir = os.path.dirname(__file__) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, os.path.join(parentdir, "src")) + from fusion_solar_py.captcha_solver_onnx import Solver currentdir = os.path.dirname(__file__)