We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe85a04 commit 1c704fcCopy full SHA for 1c704fc
tests/test_utils.py
@@ -1,4 +1,4 @@
1
-from aws_xray_sdk.ext.util import to_snake_case, get_hostname
+from aws_xray_sdk.ext.util import to_snake_case, get_hostname, strip_url
2
3
4
def test_to_snake_case():
@@ -36,3 +36,17 @@ def test_get_hostname():
36
37
s7 = get_hostname(None)
38
assert not s7
39
+
40
41
+def test_strip_url():
42
+ s1 = strip_url("https://amazon.com/page?getdata=response&stuff=morestuff")
43
+ assert s1 == "https://amazon.com/page"
44
45
+ s2 = strip_url("aws.google.com/index.html?field=data&suchcool=data")
46
+ assert s2 == "aws.google.com/index.html"
47
48
+ s3 = strip_url("INVALID_URL")
49
+ assert s3 == "INVALID_URL"
50
51
+ assert strip_url("") == ""
52
+ assert not strip_url(None)
0 commit comments