From b27360e366bdad2d057703d983bc452536260fcf Mon Sep 17 00:00:00 2001 From: Felix Blanke <info@fblanke.de> Date: Tue, 4 Mar 2025 14:49:39 +0100 Subject: [PATCH] Format --- AKModel/tests/test_json_export.py | 8 ++++++-- AKModel/utils.py | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/AKModel/tests/test_json_export.py b/AKModel/tests/test_json_export.py index 80a0827..5ec1174 100644 --- a/AKModel/tests/test_json_export.py +++ b/AKModel/tests/test_json_export.py @@ -37,7 +37,9 @@ class JSONExportTest(TestCase): is_active=True, ) - cls.json_export_validator = construct_schema_validator("solver-input.schema.json") + cls.json_export_validator = construct_schema_validator( + "solver-input.schema.json" + ) def setUp(self): self.client.force_login(self.admin_user) @@ -120,7 +122,9 @@ class JSONExportTest(TestCase): with self.subTest(event=event): self.set_up_event(event=event) - error = best_match(self.json_export_validator.iter_errors(self.export_dict)) + error = best_match( + self.json_export_validator.iter_errors(self.export_dict) + ) msg = "" if error is None else error.message self.assertTrue(error is None, msg) diff --git a/AKModel/utils.py b/AKModel/utils.py index b53e650..3a0b3f0 100644 --- a/AKModel/utils.py +++ b/AKModel/utils.py @@ -7,6 +7,7 @@ from referencing import Registry, Resource from AKPlanning import settings + def construct_schema_validator(schema: str | dict) -> Validator: """Construct a validator for a JSON schema. @@ -23,6 +24,4 @@ def construct_schema_validator(schema: str | dict) -> Validator: if isinstance(schema, str): with (schema_base_path / schema).open("r") as ff: schema = json.load(ff) - return Draft202012Validator( - schema=schema, registry=registry - ) + return Draft202012Validator(schema=schema, registry=registry) -- GitLab