Fix ruff formatting in authclient test_authclient.py
Docker / Docker Build & Push (push) Successful in 3m50s
Docker / Docker Build & Push (push) Successful in 3m50s
Reformat the new scheme-detection test cases with `ruff format` (line length) so `ruff format --check .` passes in consumers that lint the whole repo, e.g. Heretic/HordeWorker's CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
40578f5392
commit
cd0db77208
1 file changed
+9
-3
@@ -52,7 +52,9 @@ def _fake_http_error(status: int, payload: dict) -> urllib.error.HTTPError:
|
|||||||
class AuthClientBaseUrlTests(unittest.TestCase):
|
class AuthClientBaseUrlTests(unittest.TestCase):
|
||||||
def test_bare_public_host_assumes_https(self) -> None:
|
def test_bare_public_host_assumes_https(self) -> None:
|
||||||
self.assertEqual(AuthClient("auth.example.com").base_url, "https://auth.example.com")
|
self.assertEqual(AuthClient("auth.example.com").base_url, "https://auth.example.com")
|
||||||
self.assertEqual(AuthClient("auth.example.com:8080").base_url, "https://auth.example.com:8080")
|
self.assertEqual(
|
||||||
|
AuthClient("auth.example.com:8080").base_url, "https://auth.example.com:8080"
|
||||||
|
)
|
||||||
|
|
||||||
def test_bare_private_host_assumes_http(self) -> None:
|
def test_bare_private_host_assumes_http(self) -> None:
|
||||||
self.assertEqual(AuthClient("192.168.1.50:8080").base_url, "http://192.168.1.50:8080")
|
self.assertEqual(AuthClient("192.168.1.50:8080").base_url, "http://192.168.1.50:8080")
|
||||||
@@ -70,9 +72,13 @@ class AuthClientBaseUrlTests(unittest.TestCase):
|
|||||||
|
|
||||||
def test_explicit_scheme_left_alone(self) -> None:
|
def test_explicit_scheme_left_alone(self) -> None:
|
||||||
self.assertEqual(AuthClient("http://auth.example.com").base_url, "http://auth.example.com")
|
self.assertEqual(AuthClient("http://auth.example.com").base_url, "http://auth.example.com")
|
||||||
self.assertEqual(AuthClient("https://auth.example.com").base_url, "https://auth.example.com")
|
self.assertEqual(
|
||||||
|
AuthClient("https://auth.example.com").base_url, "https://auth.example.com"
|
||||||
|
)
|
||||||
self.assertEqual(AuthClient("HTTP://auth.example.com").base_url, "HTTP://auth.example.com")
|
self.assertEqual(AuthClient("HTTP://auth.example.com").base_url, "HTTP://auth.example.com")
|
||||||
self.assertEqual(AuthClient("https://192.168.1.50:8080").base_url, "https://192.168.1.50:8080")
|
self.assertEqual(
|
||||||
|
AuthClient("https://192.168.1.50:8080").base_url, "https://192.168.1.50:8080"
|
||||||
|
)
|
||||||
|
|
||||||
def test_trailing_slash_stripped_before_scheme_check(self) -> None:
|
def test_trailing_slash_stripped_before_scheme_check(self) -> None:
|
||||||
self.assertEqual(AuthClient("auth.example.com/").base_url, "https://auth.example.com")
|
self.assertEqual(AuthClient("auth.example.com/").base_url, "https://auth.example.com")
|
||||||
|
|||||||
Reference in new issue
Block a user