예제 #1
0
 def test_can_dump_map_with_backticks_in_key(self):
     assert cypher.dumps({"number `one`": 1}) == '{`number ``one```: 1}'
예제 #2
0
 def test_can_dump_list(self):
     assert cypher.dumps([4, 5, 6]) == '[4, 5, 6]'
예제 #3
0
 def test_can_dump_map(self):
     assert cypher.dumps({"one": 1}) == '{one: 1}'
예제 #4
0
 def test_can_dump_map_with_space_in_key(self):
     assert cypher.dumps({"number one": 1}) == '{`number one`: 1}'
예제 #5
0
 def test_can_dump_string(self):
     assert cypher.dumps('hello') == '"hello"'
예제 #6
0
 def test_can_dump_number(self):
     assert cypher.dumps(42) == '42'
예제 #7
0
 def test_can_dump_map_with_backticks_in_key(self):
     assert cypher.dumps({"number `one`": 1}) == '{`number ``one```: 1}'
예제 #8
0
 def test_can_dump_list(self):
     assert cypher.dumps([4, 5, 6]) == '[4, 5, 6]'
예제 #9
0
 def test_can_dump_map_with_space_in_key(self):
     assert cypher.dumps({"number one": 1}) == '{`number one`: 1}'
예제 #10
0
 def test_can_dump_map(self):
     assert cypher.dumps({"one": 1}) == '{one: 1}'
예제 #11
0
 def test_can_dump_number(self):
     assert cypher.dumps(42) == '42'
예제 #12
0
 def test_can_dump_string(self):
     assert cypher.dumps('hello') == '"hello"'
예제 #13
0
파일: xmlutil.py 프로젝트: zrg1993/py2neo
def cyphify(obj, ensure_ascii=True):
    return cypher.dumps(obj, separators=(",", ":"), ensure_ascii=ensure_ascii)