diff options
author | 2023-05-06 20:09:19 +0100 | |
---|---|---|
committer | 2023-05-31 13:03:54 +0100 | |
commit | ed602405df8e4ddf9e7993e42eea9a5e9afd4856 (patch) | |
tree | 3c2284b9d1ef15fa423875be832207b2a06ca291 /tests/pydis_core | |
parent | Bump action step versions in CI (diff) |
Apply fixes for ruff linting
Diffstat (limited to 'tests/pydis_core')
-rw-r--r-- | tests/pydis_core/test_api.py | 8 | ||||
-rw-r--r-- | tests/pydis_core/utils/test_regex.py | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/pydis_core/test_api.py b/tests/pydis_core/test_api.py index 92444e19..56977f07 100644 --- a/tests/pydis_core/test_api.py +++ b/tests/pydis_core/test_api.py @@ -32,7 +32,7 @@ class APIClientTests(unittest.IsolatedAsyncioTestCase): def test_response_code_error_initialization_with_json(self): """Test the initialization of `ResponseCodeError` with json.""" - json_data = {'hello': 'world'} + json_data = {"hello": "world"} error = site_api.ResponseCodeError( response=self.error_api_response, response_json=json_data, @@ -42,7 +42,7 @@ class APIClientTests(unittest.IsolatedAsyncioTestCase): def test_response_code_error_string_representation_with_nonempty_response_json(self): """Test the string representation of `ResponseCodeError` initialized with json.""" - json_data = {'hello': 'world'} + json_data = {"hello": "world"} error = site_api.ResponseCodeError( response=self.error_api_response, response_json=json_data @@ -51,7 +51,7 @@ class APIClientTests(unittest.IsolatedAsyncioTestCase): def test_response_code_error_initialization_with_text(self): """Test the initialization of `ResponseCodeError` with text.""" - text_data = 'Lemon will eat your soul' + text_data = "Lemon will eat your soul" error = site_api.ResponseCodeError( response=self.error_api_response, response_text=text_data, @@ -61,7 +61,7 @@ class APIClientTests(unittest.IsolatedAsyncioTestCase): def test_response_code_error_string_representation_with_nonempty_response_text(self): """Test the string representation of `ResponseCodeError` initialized with text.""" - text_data = 'Lemon will eat your soul' + text_data = "Lemon will eat your soul" error = site_api.ResponseCodeError( response=self.error_api_response, response_text=text_data diff --git a/tests/pydis_core/utils/test_regex.py b/tests/pydis_core/utils/test_regex.py index 01a2412b..1cf90711 100644 --- a/tests/pydis_core/utils/test_regex.py +++ b/tests/pydis_core/utils/test_regex.py @@ -1,10 +1,9 @@ import unittest -from typing import Optional from pydis_core.utils.regex import DISCORD_INVITE -def match_regex(s: str) -> Optional[str]: +def match_regex(s: str) -> str | None: """Helper function to run re.match on a string. Return the invite capture group, if the string matches the pattern @@ -14,7 +13,7 @@ def match_regex(s: str) -> Optional[str]: return result if result is None else result.group("invite") -def search_regex(s: str) -> Optional[str]: +def search_regex(s: str) -> str | None: """Helper function to run re.search on a string. Return the invite capture group, if the string matches the pattern |