Skip to content

Commit 0623b4a

Browse files
author
inspxctelement
committed
chore: address comments
1 parent 83bd648 commit 0623b4a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/validators/ip_address.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def _check_private_ip(value: str, is_private: Optional[bool]):
3434
or re.match(r"^(?:22[4-9]|23[0-9]|24[0-9]|25[0-5])\.", value) # broadcast
3535
):
3636
return is_private
37-
else:
38-
return not is_private
37+
38+
return not is_private
3939

4040

4141
@validator

tests/test_ip_address.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_returns_failed_validation_on_invalid_ipv6_cidr_address(
160160
("0.0.0.0", True),
161161
],
162162
)
163-
def test_returns_valid_on_private_ipv4_address(address: str, private: bool):
163+
def test_returns_true_on_valid_private_ipv4_address(address: str, private: bool):
164164
"""Test returns true on private ipv4 address."""
165165
assert ipv4(address, private=private)
166166

@@ -186,7 +186,7 @@ def test_returns_failed_validation_on_invalid_private_ipv4_address(address: str,
186186
("7.53.12.1", False),
187187
],
188188
)
189-
def test_returns_valid_on_public_ipv4_address(address: str, private: bool):
189+
def test_returns_true_on_valid_public_ipv4_address(address: str, private: bool):
190190
"""Test returns true on valid public ipv4 address."""
191191
assert ipv4(address, private=private)
192192

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

0 commit comments

Comments
 (0)