From f5fac17f8cca3b14e1f2437124b76f94dd268e24 Mon Sep 17 00:00:00 2001 From: indy koning Date: Thu, 15 Oct 2026 20:33:22 +0200 Subject: [PATCH 1/5] Added action to run tests --- .github/workflows/pytest.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..5be622a --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,15 @@ +name: pytest +on: + - push + - pull_request + +jobs: + pytest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: ln -s ../growattServer tests/growattServer + - run: pytest tests --doctest-modules --junitxml=junit/test-results.xml From f715f64f3267e54854561fa8e71d325cd32064b5 Mon Sep 17 00:00:00 2001 From: indy koning Date: Thu, 15 Oct 2026 20:34:56 +0200 Subject: [PATCH 2/5] Fixed missing line --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5be622a..628ed7b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -11,5 +11,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" + - run: pip install pytest - run: ln -s ../growattServer tests/growattServer - run: pytest tests --doctest-modules --junitxml=junit/test-results.xml From a0ec03dc819b1630e03bb057d7c84512228b8497 Mon Sep 17 00:00:00 2001 From: indy koning Date: Thu, 15 Oct 2026 20:51:32 +0200 Subject: [PATCH 3/5] Requirements.txt --- .github/workflows/pytest.yml | 1 + requirements.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 628ed7b..f99aad3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -12,5 +12,6 @@ jobs: with: python-version: "3.12" - run: pip install pytest + - run: pip install -r requirements.txt - run: ln -s ../growattServer tests/growattServer - run: pytest tests --doctest-modules --junitxml=junit/test-results.xml diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests From 8b11c71cf588d1f00ab3e1a4a1c054c2ae65a321 Mon Sep 17 00:00:00 2001 From: indy koning Date: Thu, 15 Oct 2026 20:54:31 +0200 Subject: [PATCH 4/5] Break test --- growattServer/base_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/growattServer/base_api.py b/growattServer/base_api.py index 7b5e75e..7cf655e 100644 --- a/growattServer/base_api.py +++ b/growattServer/base_api.py @@ -57,7 +57,7 @@ def _raise_if_rate_limited(response: requests.Response) -> None: data = back if not data.get("success", True) and str(data.get("msg", "")) == RATE_LIMITED_CODE: - raise GrowattRateLimitError(error_code=RATE_LIMITED_CODE) + # raise GrowattRateLimitError(error_code=RATE_LIMITED_CODE) def hash_password(password: str) -> str: From 6165dc234ea23a874acf818c8cfd116eaf98ec1e Mon Sep 17 00:00:00 2001 From: indy koning Date: Thu, 15 Oct 2026 20:56:31 +0200 Subject: [PATCH 5/5] Fix test --- growattServer/base_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/growattServer/base_api.py b/growattServer/base_api.py index 7cf655e..7b5e75e 100644 --- a/growattServer/base_api.py +++ b/growattServer/base_api.py @@ -57,7 +57,7 @@ def _raise_if_rate_limited(response: requests.Response) -> None: data = back if not data.get("success", True) and str(data.get("msg", "")) == RATE_LIMITED_CODE: - # raise GrowattRateLimitError(error_code=RATE_LIMITED_CODE) + raise GrowattRateLimitError(error_code=RATE_LIMITED_CODE) def hash_password(password: str) -> str: