Skip to content

Commit

Permalink
fix: update dependencies to match home assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzoghenzo committed Nov 19, 2023
1 parent f675901 commit 6fc134f
Show file tree
Hide file tree
Showing 6 changed files with 498 additions and 378 deletions.
825 changes: 470 additions & 355 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion psa_ccc/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def oauth_factory(
token_url: str,
realm: str,
token_storage: TokenStorage,
) -> AsyncOAuth2Client:
) -> AsyncOAuth2Client: # pragma: no cover
"""
Create the OAuth session handler for the API client.
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ packages = [{include = "psa_ccc"}]

[tool.poetry.dependencies]
python = "^3.10"
httpx = "^0.24.1"
httpx = "^0.25.1"
authlib = "^1.2.0"
msgspec = "^0.18.2"
msgspec = "^0.18.4"
cryptography = "^41.0.2"
pyaxmlparser = "^0.3.28"

Expand All @@ -21,7 +21,7 @@ optional = true
pytest = "^7.2.1"
coverage = {extras = ["toml"], version = "^7.1.0"}
pytest-cov = "^4.0.0"
pytest-httpx = "^0.24.0"
pytest-httpx = "^0.27.0"
pytest-asyncio = "^0.21.0"

[tool.poetry.group.docs]
Expand Down
24 changes: 24 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Fixtures for tests."""
from __future__ import annotations

from pathlib import Path
from tempfile import TemporaryDirectory

import httpx
import pytest
from psa_ccc import PSAClient
from psa_ccc import SimpleCacheStorage


@pytest.fixture
def client() -> PSAClient:
http_client = httpx.AsyncClient(
base_url="https://api.groupe-psa.com/connectedcar/v4"
)
yield PSAClient(client=http_client)


@pytest.fixture
def temp_storage() -> SimpleCacheStorage:
with TemporaryDirectory() as temp_directory:
yield SimpleCacheStorage(Path(temp_directory))
10 changes: 0 additions & 10 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@

import datetime

import httpx
import pytest
from psa_ccc import models
from psa_ccc.client import ApiError
from psa_ccc.client import PSAClient


@pytest.fixture
def client() -> PSAClient:
http_client = httpx.AsyncClient(
base_url="https://api.groupe-psa.com/connectedcar/v4"
)
yield PSAClient(client=http_client)


@pytest.mark.asyncio
Expand Down
9 changes: 0 additions & 9 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
"""Simple Cache Storage tests."""
from __future__ import annotations

from pathlib import Path
from tempfile import TemporaryDirectory

import pytest
from psa_ccc.storage import SimpleCacheStorage


@pytest.fixture
def temp_storage() -> SimpleCacheStorage:
with TemporaryDirectory() as temp_directory:
yield SimpleCacheStorage(Path(temp_directory))


def test_file_doesnt_exist(temp_storage: SimpleCacheStorage) -> None:
assert not temp_storage.exists("test")

Expand Down

0 comments on commit 6fc134f

Please sign in to comment.