We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22e81e5 commit d5dc3eeCopy full SHA for d5dc3ee
tests/utils/test_sanitize.py
@@ -0,0 +1,18 @@
1
+import pytest
2
+
3
+from src.utils.sanitize import sanitize_url
4
5
6
+@pytest.mark.parametrize(
7
+ ("url", "expected"),
8
+ [
9
+ (None, None),
10
+ ("", ""),
11
+ ("https://example.com/data.tar.bz2", "https://example.com/data.tar.bz2"),
12
+ ("https://user@example.com/data.tar.bz2", "https://***@example.com/data.tar.bz2"),
13
+ ("https://user:secret@example.com/data.tar.bz2", "https://***@example.com/data.tar.bz2"),
14
+ ("https://user:secret@example.com:8443/data.tar.bz2", "https://***@example.com:8443/data.tar.bz2"),
15
+ ],
16
+)
17
+def test_sanitize_url(url: str | None, expected: str | None):
18
+ assert sanitize_url(url) == expected
0 commit comments