From 751e8ed779940548d7b3391e3f5799245e6dad67 Mon Sep 17 00:00:00 2001 From: Myhailo Chernyshov Date: Thu, 5 Dec 2024 18:36:34 +0200 Subject: [PATCH] style: Code style is improved --- src/cc2olx/validators/cli.py | 4 +--- tests/test_cli.py | 2 +- tests/test_validators/test_cli.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cc2olx/validators/cli.py b/src/cc2olx/validators/cli.py index ee8482f..bfa1e23 100644 --- a/src/cc2olx/validators/cli.py +++ b/src/cc2olx/validators/cli.py @@ -19,9 +19,7 @@ class LinkSourceValidator: IPV6_REGEX = r"\[[0-9a-f:.]+\]" # (simple regex, validated later) # Host patterns - HOSTNAME_REGEX = ( - rf"[a-z{UL}0-9](?:[a-z{UL}0-9-]{{0,61}}[a-z{UL}0-9])?" - ) + HOSTNAME_REGEX = rf"[a-z{UL}0-9](?:[a-z{UL}0-9-]{{0,61}}[a-z{UL}0-9])?" # Max length for domain name labels is 63 characters per RFC 1034 sec. 3.1 DOMAIN_REGEX = rf"(?:\.(?!-)[a-z{UL}0-9-]{{1,63}}(? No """ Test arguments parser detects incorrect relative links sources. """ - relative_links_source = "ws://example.com", + relative_links_source = "ws://example.com" with pytest.raises(SystemExit): parse_args(["-i", str(imscc_file), "-s", relative_links_source]) diff --git a/tests/test_validators/test_cli.py b/tests/test_validators/test_cli.py index b75a0f5..5d11159 100644 --- a/tests/test_validators/test_cli.py +++ b/tests/test_validators/test_cli.py @@ -19,7 +19,7 @@ class TestLinkSourceValidator: "http://192.168.0.1", "http://192.168.0.1:8000/", "https://[2001:0db8:85a3::8a2e:0370:7334]/", - ) + ), ) def test_original_value_is_returned_if_it_is_valid(self, links_source: str) -> None: """ @@ -39,7 +39,7 @@ def test_original_value_is_returned_if_it_is_valid(self, links_source: str) -> N "https://m192.168.0.1", "https://2001:0db8:85a3::8a2e:0370:7334/", "https://[2001:db8:85a3::8a2e:0370:7334::]/", - ) + ), ) def test_wrong_values_are_detected(self, links_source) -> None: """