Skip to content

Commit 443b934

Browse files
chore: remove unused function sanitize_parameters()
The function sanitize_parameters() was used when the v3 API was in use. Since v3 API support has been removed there are no more users of this function.
1 parent 916a7fe commit 443b934

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

gitlab/tests/test_utils.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,3 @@ def test_sanitized_url():
4040
src = "http://localhost/foo.bar.baz"
4141
dest = "http://localhost/foo%2Ebar%2Ebaz"
4242
assert dest == utils.sanitized_url(src)
43-
44-
45-
def test_sanitize_parameters_does_nothing():
46-
assert 1 == utils.sanitize_parameters(1)
47-
assert 1.5 == utils.sanitize_parameters(1.5)
48-
assert "foo" == utils.sanitize_parameters("foo")
49-
50-
51-
def test_sanitize_parameters_slash():
52-
assert "foo%2Fbar" == utils.sanitize_parameters("foo/bar")
53-
54-
55-
def test_sanitize_parameters_slash_and_percent():
56-
assert "foo%2Fbar%25quuz" == utils.sanitize_parameters("foo/bar%quuz")
57-
58-
59-
def test_sanitize_parameters_dict():
60-
source = {"url": "foo/bar", "id": 1}
61-
expected = {"url": "foo%2Fbar", "id": 1}
62-
assert expected == utils.sanitize_parameters(source)

gitlab/utils.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ def clean_str_id(id: str) -> str:
6060
return quote(id, safe="")
6161

6262

63-
def sanitize_parameters(value):
64-
if isinstance(value, dict):
65-
return dict((k, sanitize_parameters(v)) for k, v in value.items())
66-
if isinstance(value, str):
67-
return quote(value, safe="")
68-
return value
69-
70-
7163
def sanitized_url(url: str) -> str:
7264
parsed = urlparse(url)
7365
new_path = parsed.path.replace(".", "%2E")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy