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 63d3fe3 commit 9524b31Copy full SHA for 9524b31
redisgraph/util.py
@@ -27,10 +27,4 @@ def quote_string(v):
27
28
v = v.replace('"', '\\"')
29
30
- if v[0] != '"':
31
- v = '"' + v
32
-
33
- if v[-1] != '"':
34
- v = v + '"'
35
36
- return v
+ return '"{}"'.format(v)
tests/unit/test_util.py
@@ -14,4 +14,6 @@ def test_quote_string(self):
14
self.assertEqual(util.quote_string(10), 10)
15
self.assertEqual(util.quote_string("abc"), '"abc"')
16
self.assertEqual(util.quote_string(""), '""')
17
+ self.assertEqual(util.quote_string('\"'), '"\\\""')
18
+ self.assertEqual(util.quote_string('"'), '"\\""')
19
self.assertEqual(util.quote_string('a"a'), '"a\\"a"')
0 commit comments