Skip to content

Commit

Permalink
[#197] apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonny Bakker committed Nov 14, 2024
1 parent eaa9015 commit 423ed1a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/openklant/migration/test_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import json


from http.server import BaseHTTPRequestHandler, HTTPServer


Expand Down
4 changes: 3 additions & 1 deletion src/openklant/migration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 2 additions & 6 deletions src/openklant/migration/v1/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
3 changes: 1 addition & 2 deletions src/openklant/tests/test_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
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 (
Organisatie,
Partij,
Persoon,
)
from openklant.migration.utils import generate_jwt_token
from openklant.tests.vcr import VCRMixin


LIVE_SERVER_HOST = "localhost"
LIVE_SERVER_PORT = 8005

Expand Down
5 changes: 1 addition & 4 deletions src/openklant/tests/vcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from vcr.unittest import VCRMixin as _VCRMixin


RECORD_MODE = os.environ.get("VCR_RECORD_MODE", "none")


Expand All @@ -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()
Expand Down

0 comments on commit 423ed1a

Please sign in to comment.