From 423ed1a7d089b7c8d7c87188c43dd30063872542 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Thu, 14 Nov 2024 15:57:10 +0100 Subject: [PATCH] [#197] apply formatting --- src/openklant/migration/test_server.py | 2 -- src/openklant/migration/utils.py | 4 +++- src/openklant/migration/v1/data.py | 8 ++------ src/openklant/tests/test_migrate.py | 3 +-- src/openklant/tests/vcr.py | 5 +---- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/openklant/migration/test_server.py b/src/openklant/migration/test_server.py index f2c6f363..c487e08b 100644 --- a/src/openklant/migration/test_server.py +++ b/src/openklant/migration/test_server.py @@ -1,6 +1,4 @@ import json - - from http.server import BaseHTTPRequestHandler, HTTPServer diff --git a/src/openklant/migration/utils.py b/src/openklant/migration/utils.py index 526020e0..a58c7e38 100644 --- a/src/openklant/migration/utils.py +++ b/src/openklant/migration/utils.py @@ -4,7 +4,9 @@ # Can be used to easily generate a encoded JWT token given the client_id and secret -def generate_jwt_token(client_id: str, secret: str, user_representation: str = "") -> str: +def generate_jwt_token( + client_id: str, secret: str, user_representation: str = "" +) -> str: payload = { # standard claims "iss": "testsuite", diff --git a/src/openklant/migration/v1/data.py b/src/openklant/migration/v1/data.py index 5d9c5e37..8a6bb631 100644 --- a/src/openklant/migration/v1/data.py +++ b/src/openklant/migration/v1/data.py @@ -156,12 +156,8 @@ def set_from_external_subject(self, subject_data: dict) -> None: self.subject_identificatie = subject_data subject_fields = { - subject_class: [ - field.name for field in dataclass_fields(subject_class) - ] - for subject_class in ( - NatuurlijkPersoon, NietNatuurlijkPersoon, Vestiging - ) + subject_class: [field.name for field in dataclass_fields(subject_class)] + for subject_class in (NatuurlijkPersoon, NietNatuurlijkPersoon, Vestiging) } for subject_class, fields in subject_fields.items(): diff --git a/src/openklant/tests/test_migrate.py b/src/openklant/tests/test_migrate.py index 093b2b2b..4b10223f 100644 --- a/src/openklant/tests/test_migrate.py +++ b/src/openklant/tests/test_migrate.py @@ -11,7 +11,6 @@ from vcr.config import RecordMode from vng_api_common.tests import reverse -from openklant.migration.utils import generate_jwt_token from openklant.components.klantinteracties.models.constants import SoortPartij from openklant.components.klantinteracties.models.digitaal_adres import DigitaalAdres from openklant.components.klantinteracties.models.partijen import ( @@ -19,9 +18,9 @@ Partij, Persoon, ) +from openklant.migration.utils import generate_jwt_token from openklant.tests.vcr import VCRMixin - LIVE_SERVER_HOST = "localhost" LIVE_SERVER_PORT = 8005 diff --git a/src/openklant/tests/vcr.py b/src/openklant/tests/vcr.py index 0c19d0d3..74b96755 100644 --- a/src/openklant/tests/vcr.py +++ b/src/openklant/tests/vcr.py @@ -3,7 +3,6 @@ from vcr.unittest import VCRMixin as _VCRMixin - RECORD_MODE = os.environ.get("VCR_RECORD_MODE", "none") @@ -23,9 +22,7 @@ def _get_cassette_library_dir(self): assert ( self.VCR_TEST_FILES ), "You must define the `VCR_TEST_FILES` class attribute" - return str( - self.VCR_TEST_FILES / "vcr_cassettes" / self.__class__.__qualname__ - ) + return str(self.VCR_TEST_FILES / "vcr_cassettes" / self.__class__.__qualname__) def _get_vcr_kwargs(self, **kwargs) -> dict: kwargs = super()._get_vcr_kwargs()