From e8e80cb6adb74af10489f412262f69e7921fc6d7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:43:31 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- oauth2_provider/validators.py | 10 ++++------ tests/test_validators.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/oauth2_provider/validators.py b/oauth2_provider/validators.py index 04c323ab7..1654dccd7 100644 --- a/oauth2_provider/validators.py +++ b/oauth2_provider/validators.py @@ -70,17 +70,17 @@ def __call__(self, value): if query and not self.allow_query: raise ValidationError( "%(name)s URI validation error. %(cause)s: %(value)s", - params={ "name": self.name, "value": value, "cause": 'query string not allowed'} + params={"name": self.name, "value": value, "cause": "query string not allowed"}, ) if fragment and not self.allow_fragments: raise ValidationError( "%(name)s URI validation error. %(cause)s: %(value)s", - params={ "name": self.name, "value": value, "cause": 'fragment not allowed'} + params={"name": self.name, "value": value, "cause": "fragment not allowed"}, ) if path and not self.allow_path: raise ValidationError( "%(name)s URI validation error. %(cause)s: %(value)s", - params={ "name": self.name, "value": value, "cause": 'path not allowed'} + params={"name": self.name, "value": value, "cause": "path not allowed"}, ) try: @@ -88,12 +88,10 @@ def __call__(self, value): except ValidationError as e: raise ValidationError( "%(name)s URI validation error. %(cause)s: %(value)s", - params={ "name": self.name, "value": value, "cause": e} + params={"name": self.name, "value": value, "cause": e}, ) - - ## # WildcardSet is a special set that contains everything. # This is required in order to move validation of the scheme from diff --git a/tests/test_validators.py b/tests/test_validators.py index 66d746966..24f641c43 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -122,7 +122,7 @@ def test_invalid_schemes(self): "http:/example.com", "HTTP://localhost", "HTTP://example.com", - "HTTP://-example.com-", # triggers an exception in the upstream validators + "HTTP://-example.com-", # triggers an exception in the upstream validators "HTTP://example.com/path", "HTTP://example.com/path?query=string", "HTTP://example.com/path?query=string#fragmemt",