Skip to content

Commit

Permalink
style: Code style is improved
Browse files Browse the repository at this point in the history
  • Loading branch information
myhailo-chernyshov-rg committed Dec 18, 2024
1 parent bc298c2 commit 751e8ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/cc2olx/validators/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}}(?<!-))*"
TLD_REGEX = (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_parse_args_with_incorrect_relative_links_source(imscc_file: Path) -> 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])
4 changes: 2 additions & 2 deletions tests/test_validators/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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:
"""
Expand Down

0 comments on commit 751e8ed

Please sign in to comment.