diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bb7e94e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +# Based on https://github.com/marketplace/actions/python-poetry-action + +name: Run tests + +on: + - push + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.9 + uses: actions/setup-python@v3 + with: + python-version: "3.9" + + - name: Install poetry + uses: abatilo/actions-poetry@v4 + + - name: Setup a local virtual environment (if no poetry.toml file) + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + + - uses: actions/cache@v3 + name: Define a cache for the virtual environment based on the lock file + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} + + - name: Install dependencies + run: poetry install + + - name: Run tests + run: poetry run pytest -vv diff --git a/tests/armis_sdk/entities/sites_test.py b/tests/armis_sdk/entities/sites_test.py index e0c7eec..2d36d72 100644 --- a/tests/armis_sdk/entities/sites_test.py +++ b/tests/armis_sdk/entities/sites_test.py @@ -58,7 +58,7 @@ async def test_get_sites(from_response, expected, httpx_mock: pytest_httpx.HTTPX async def test_get_sites_with_multiple_pages( monkeypatch, httpx_mock: pytest_httpx.HTTPXMock ): - monkeypatch.setenv("ARMIS_PAGE_SIZE", 2) + monkeypatch.setenv("ARMIS_PAGE_SIZE", "2") httpx_mock.add_response( url="https://mock_tenant.armis.com/api/v1/sites/?from=0&length=2", method="GET",