-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds
private
parameter to ip_address
, hostname
& url
- Loading branch information
Showing
4 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,19 @@ def test_returns_true_on_valid_url(value: str): | |
assert url(value) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"address, private", | ||
[ | ||
("http://username:[email protected]/", True), | ||
("http://username:[email protected]:4010/", True), | ||
("http://127.0.0.1", True), | ||
], | ||
) | ||
def test_returns_true_on_valid_private_url(address, private): | ||
"""Test returns true on valid private url.""" | ||
assert url(address, private=private) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"value", | ||
[ | ||
|
@@ -188,3 +201,17 @@ def test_returns_true_on_valid_url(value: str): | |
def test_returns_failed_validation_on_invalid_url(value: str): | ||
"""Test returns failed validation on invalid url.""" | ||
assert isinstance(url(value), ValidationError) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"address, private", | ||
[ | ||
("http://username:[email protected]:4010", False), | ||
("http://username:[email protected]:8080", False), | ||
("http://10.0.10.1", False), | ||
("http://255.255.255.255", False), | ||
], | ||
) | ||
def test_returns_failed_validation_on_invalid_private_url(address, private): | ||
"""Test returns failed validation on invalid private url.""" | ||
assert isinstance(url(address, private=private), ValidationError) |