Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
inspxctelement committed May 17, 2024
1 parent 83bd648 commit 0623b4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/validators/ip_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def _check_private_ip(value: str, is_private: Optional[bool]):
or re.match(r"^(?:22[4-9]|23[0-9]|24[0-9]|25[0-5])\.", value) # broadcast
):
return is_private
else:
return not is_private

return not is_private


@validator
Expand Down
6 changes: 3 additions & 3 deletions tests/test_ip_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_returns_failed_validation_on_invalid_ipv6_cidr_address(
("0.0.0.0", True),
],
)
def test_returns_valid_on_private_ipv4_address(address: str, private: bool):
def test_returns_true_on_valid_private_ipv4_address(address: str, private: bool):
"""Test returns true on private ipv4 address."""
assert ipv4(address, private=private)

Expand All @@ -186,7 +186,7 @@ def test_returns_failed_validation_on_invalid_private_ipv4_address(address: str,
("7.53.12.1", False),
],
)
def test_returns_valid_on_public_ipv4_address(address: str, private: bool):
def test_returns_true_on_valid_public_ipv4_address(address: str, private: bool):
"""Test returns true on valid public ipv4 address."""
assert ipv4(address, private=private)

Expand All @@ -201,6 +201,6 @@ def test_returns_valid_on_public_ipv4_address(address: str, private: bool):
("0.0.0.0", False),
],
)
def test_returns_failed_validation_on_private_ipv4_address(address: str, private: bool):
def test_returns_failed_validation_on_invalid_public_ipv4_address(address: str, private: bool):
"""Test returns failed validation on private ipv4 address."""
assert isinstance(ipv4(address, private=private), ValidationError)

0 comments on commit 0623b4a

Please sign in to comment.