summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/tests/test_utils.py')
-rw-r--r--gitlab/tests/test_utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gitlab/tests/test_utils.py b/gitlab/tests/test_utils.py
index 50aaecf..5a8148c 100644
--- a/gitlab/tests/test_utils.py
+++ b/gitlab/tests/test_utils.py
@@ -27,6 +27,10 @@ def test_clean_str_id():
dest = "foo%23bar%2Fbaz%2F"
assert dest == utils.clean_str_id(src)
+ src = "foo%bar/baz/"
+ dest = "foo%25bar%2Fbaz%2F"
+ assert dest == utils.clean_str_id(src)
+
def test_sanitized_url():
src = "http://localhost/foo/bar"
@@ -48,6 +52,10 @@ def test_sanitize_parameters_slash():
assert "foo%2Fbar" == utils.sanitize_parameters("foo/bar")
+def test_sanitize_parameters_slash_and_percent():
+ assert "foo%2Fbar%25quuz" == utils.sanitize_parameters("foo/bar%quuz")
+
+
def test_sanitize_parameters_dict():
source = {"url": "foo/bar", "id": 1}
expected = {"url": "foo%2Fbar", "id": 1}