From ed21e978265ded34949985216ad5485ff94a4c7b Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 19 Apr 2024 11:46:20 +0100 Subject: [PATCH] Add trailing commas from COM812 suggestions Do not enable the rule as Ruff complains that it can conflict with the formatter. --- src/mock_vws/_flask_server/vws.py | 6 ++++-- .../_services_validators/content_type_validators.py | 2 +- tests/mock_vws/test_flask_app_usage.py | 3 ++- tests/mock_vws/test_query.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mock_vws/_flask_server/vws.py b/src/mock_vws/_flask_server/vws.py index 27568d46c..ae3a2a082 100644 --- a/src/mock_vws/_flask_server/vws.py +++ b/src/mock_vws/_flask_server/vws.py @@ -274,7 +274,8 @@ def get_target(target_id: str) -> Response: @VWS_FLASK_APP.route( - "/targets/", methods=[HTTPMethod.DELETE] + "/targets/", + methods=[HTTPMethod.DELETE], ) def delete_target(target_id: str) -> Response: """ @@ -433,7 +434,8 @@ def target_summary(target_id: str) -> Response: @VWS_FLASK_APP.route( - "/duplicates/", methods=[HTTPMethod.GET] + "/duplicates/", + methods=[HTTPMethod.GET], ) def get_duplicates(target_id: str) -> Response: """ diff --git a/src/mock_vws/_services_validators/content_type_validators.py b/src/mock_vws/_services_validators/content_type_validators.py index 654242d93..1e3c3e9b4 100644 --- a/src/mock_vws/_services_validators/content_type_validators.py +++ b/src/mock_vws/_services_validators/content_type_validators.py @@ -26,7 +26,7 @@ def validate_content_type_header_given( request requires one. """ request_needs_content_type = bool( - request_method in {HTTPMethod.POST, HTTPMethod.PUT} + request_method in {HTTPMethod.POST, HTTPMethod.PUT}, ) if request_headers.get("Content-Type") or not request_needs_content_type: return diff --git a/tests/mock_vws/test_flask_app_usage.py b/tests/mock_vws/test_flask_app_usage.py index d2ae9736a..f9ec015fa 100644 --- a/tests/mock_vws/test_flask_app_usage.py +++ b/tests/mock_vws/test_flask_app_usage.py @@ -293,7 +293,8 @@ def test_structural_similarity_matcher( ) -> None: """The structural similarity matcher matches similar images.""" monkeypatch.setenv( - name="QUERY_IMAGE_MATCHER", value="structural_similarity" + name="QUERY_IMAGE_MATCHER", + value="structural_similarity", ) database = VuforiaDatabase() vws_client = VWS( diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index 8bd30aebc..85cdebcb8 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -1773,7 +1773,7 @@ def test_updated_target( # second. assert target_timestamp >= original_target_timestamp time_difference = abs( - approximate_target_updated - target_timestamp.timestamp() + approximate_target_updated - target_timestamp.timestamp(), ) max_time_difference = 5 assert time_difference < max_time_difference