RedisGraph / redisgraph-py

RedisGraph python client
https://redisgraph.io
BSD 3-Clause "New" or "Revised" License
189 stars 49 forks source link

Escape backslashes in parameter strings. #157

Closed skieffer closed 2 years ago

skieffer commented 2 years ago

Fixes #139

I added the functional test tests.functional.test_all.TestStringMethods.test_properties_with_escapes() which demonstrates that, when you set a property string containing backslash or quotation mark, you get the same string back after reading.

I also rewrote the unit test tests.unit.test_util.TestUtils.test_quote_string() using raw strings, which I think makes the test much easier to read and understand.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

swilly22 commented 2 years ago

Thank you @skieffer, Out of curiosity what are you using RedisGraph for?

skieffer commented 2 years ago

Out of curiosity what are you using RedisGraph for?

It's a back end for an app that lets multiple authors share components that will be linked together -- hence the need for a graph database.

I recently added a step that stores document snippets as properties in the graph, and these snippets often have their own escaped characters within them -- including \" -- so I stumbled onto this issue.