Skip to content

Commit

Permalink
Fix #786 (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi Keshav authored May 16, 2018
1 parent cb90d28 commit a3c88be
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
10 changes: 10 additions & 0 deletions sdk/python/core/tests/test_sanity_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,16 @@ def test_inner_pres(self):
runner_read = self.crud.read(self.ncc, Runner())
self.assertEqual(runner, runner_read)

def embedded_quote_list_key(self):
r = Runner()
t = Runner.TwoKeyList()
t.first = "ab'c"
t.second = 1233
r.two_key_list.append(t)
self.crud.create(self.ncc, runner)

runner_read = self.crud.read(self.ncc, Runner())
self.assertEqual(runner, runner_read)

if __name__ == '__main__':
device, non_demand, common_cache, timeout = get_device_info()
Expand Down
18 changes: 9 additions & 9 deletions ydkgen/printer/python/class_get_entity_path_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,26 @@ def _print_get_ydk_segment_path_body(self, clazz):
key_props = clazz.get_key_props()
for key_prop in key_props:
predicates += insert_token

predicates += '"['
if key_prop.stmt.i_module.arg != clazz.stmt.i_module.arg:
predicates += key_prop.stmt.i_module.arg
predicates += ':'

predicates += key_prop.stmt.arg + '='
predicates += "'"

predicates += "\\\""

predicates +='"'

predicates += insert_token

predicates += ('str(self.%s)') % key_prop.name + insert_token

predicates += '"'
predicates += "'"

predicates += "\\\""

predicates += ']"'

path = '%s%s' % (path, predicates)
Expand Down

0 comments on commit a3c88be

Please sign in to comment.