Skip to content

Commit 169d6ea

Browse files
committed
Add tests
1 parent 452ef1a commit 169d6ea

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_domain_utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,21 @@ def test_get_stripped_url_path_params():
3535
url = 'https://my.domain.cloudfront.net/a/path/to/a/file.html?a=1'
3636
result = du.get_stripped_url(url)
3737
assert result == 'my.domain.cloudfront.net/a/path/to/a/file.html'
38+
39+
40+
def test_get_stripped_url_non_http_scheme_none():
41+
url = 'about:blank'
42+
result = du.get_stripped_url(url, non_http_scheme=None)
43+
assert result is None
44+
45+
46+
def test_get_stripped_url_non_http_scheme_return_self():
47+
url = 'about:blank'
48+
result = du.get_stripped_url(url, non_http_scheme='self')
49+
assert result == url
50+
51+
52+
def test_get_stripped_url_only_accepts_correct_args_for_non_http_scheme():
53+
with pytest.raises(ValueError):
54+
result = du.get_stripped_url(url, non_http_scheme='milk')
55+

0 commit comments

Comments
 (0)