Skip to content

Commit 1eaa90c

Browse files
committed
Removed unused API
1 parent 98df6e8 commit 1eaa90c

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

redis/commands/helpers.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,6 @@ def parse_list_to_dict(response):
7979
return res
8080

8181

82-
def parse_to_dict(response):
83-
if response is None:
84-
return {}
85-
86-
res = {}
87-
for det in response:
88-
if not isinstance(det, list) or not det:
89-
continue
90-
if len(det) == 1:
91-
res[det[0]] = True
92-
elif isinstance(det[1], list):
93-
res[det[0]] = parse_list_to_dict(det[1])
94-
else:
95-
try: # try to set the attribute. may be provided without value
96-
try: # try to convert the value to float
97-
res[det[0]] = float(det[1])
98-
except (TypeError, ValueError):
99-
res[det[0]] = det[1]
100-
except IndexError:
101-
pass
102-
return res
103-
104-
10582
def random_string(length=10):
10683
"""
10784
Returns a random N character long string.

tests/test_helpers.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
delist,
55
list_or_args,
66
nativestr,
7-
parse_to_dict,
87
parse_to_list,
98
quote_string,
109
random_string,
@@ -26,40 +25,6 @@ def test_parse_to_list():
2625
assert parse_to_list(r) == ["hello", "my name", 45, 555.55, "is simon!", None]
2726

2827

29-
def test_parse_to_dict():
30-
assert parse_to_dict(None) == {}
31-
r = [
32-
["Some number", "1.0345"],
33-
["Some string", "hello"],
34-
[
35-
"Child iterators",
36-
[
37-
"Time",
38-
"0.2089",
39-
"Counter",
40-
3,
41-
"Child iterators",
42-
["Type", "bar", "Time", "0.0729", "Counter", 3],
43-
["Type", "barbar", "Time", "0.058", "Counter", 3],
44-
["Type", "barbarbar", "Time", "0.0234", "Counter", 3],
45-
],
46-
],
47-
]
48-
assert parse_to_dict(r) == {
49-
"Child iterators": {
50-
"Child iterators": [
51-
{"Counter": 3.0, "Time": 0.0729, "Type": "bar"},
52-
{"Counter": 3.0, "Time": 0.058, "Type": "barbar"},
53-
{"Counter": 3.0, "Time": 0.0234, "Type": "barbarbar"},
54-
],
55-
"Counter": 3.0,
56-
"Time": 0.2089,
57-
},
58-
"Some number": 1.0345,
59-
"Some string": "hello",
60-
}
61-
62-
6328
def test_nativestr():
6429
assert nativestr("teststr") == "teststr"
6530
assert nativestr(b"teststr") == "teststr"

0 commit comments

Comments
 (0)