Skip to content

Commit 97c86cc

Browse files
committed
Add comprehensive test suite and GitHub Actions CI workflow
- 102 unit tests covering all public methods in VUUtil, VUAdminUtil, VUDial, and VUAdmin using pytest and the responses library for HTTP mocking (no hardware or live server required) - Tests cover happy paths, correct endpoint/param construction, HTTP error propagation, URL encoding, and boundary values (RGB 0/255, value zero, missing files, etc.) - GitHub Actions workflow runs the full suite across Python 3.11, 3.12, and 3.13 on every push and pull request to main - pyproject.toml updated with [dev] optional dependencies (pytest, responses, pytest-cov) and pytest/coverage configuration https://claude.ai/code/session_01H9Y23xpAt1rCjBCXLUdujo
1 parent 802ab11 commit 97c86cc

File tree

5 files changed

+850
-0
lines changed

5 files changed

+850
-0
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "claude/**"
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
test:
14+
name: Test (Python ${{ matrix.python-version }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.11", "3.12", "3.13"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e ".[dev]"
33+
34+
- name: Run tests
35+
run: |
36+
pytest tests/ -v --cov=vudials_client --cov-report=term-missing --cov-report=xml
37+
38+
- name: Upload coverage report
39+
uses: actions/upload-artifact@v4
40+
if: matrix.python-version == '3.12'
41+
with:
42+
name: coverage-report
43+
path: coverage.xml

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ classifiers = [
2121
license = "MIT"
2222
license-files = ["LICEN[CS]E*"]
2323

24+
[project.optional-dependencies]
25+
dev = [
26+
"pytest>=8.0",
27+
"responses>=0.25",
28+
"pytest-cov>=5.0",
29+
]
30+
2431
[project.urls]
2532
Homepage = "https://github.com/erinlkolp/vu1-dial-python-module"
2633
Issues = "https://github.com/erinlkolp/vu1-dial-python-module/issues"
34+
35+
[tool.pytest.ini_options]
36+
testpaths = ["tests"]
37+
38+
[tool.coverage.run]
39+
source = ["src/vudials_client"]
40+
omit = ["tests/*"]
41+
42+
[tool.coverage.report]
43+
show_missing = true

tests/__init__.py

Whitespace-only changes.

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pytest
2+
from vudials_client.vudialsclient import VUDial, VUAdmin
3+
4+
5+
@pytest.fixture
6+
def vudial():
7+
return VUDial("localhost", 5340, "test-api-key")
8+
9+
10+
@pytest.fixture
11+
def vuadmin():
12+
return VUAdmin("localhost", 5340, "test-admin-key")

0 commit comments

Comments
 (0)