We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73cb9ef commit a5e9f91Copy full SHA for a5e9f91
1 file changed
tests.py
@@ -70,10 +70,31 @@ def test_round_trip(self):
70
ptr = JsonPointer(path)
71
self.assertEqual(path, ptr.path)
72
73
- parts = ptr.parts
+ parts = ptr.get_parts()
74
+ self.assertEqual(parts, ptr.parts)
75
new_ptr = JsonPointer.from_parts(parts)
76
self.assertEqual(ptr, new_ptr)
77
78
+ def test_parts(self):
79
+ paths = [
80
+ ("", []),
81
+ ("/foo", ['foo']),
82
+ ("/foo/0", ['foo', '0']),
83
+ ("/", ['']),
84
+ ("/a~1b", ['a/b']),
85
+ ("/c%d", ['c%d']),
86
+ ("/e^f", ['e^f']),
87
+ ("/g|h", ['g|h']),
88
+ ("/i\\j", ['i\j']),
89
+ ("/k\"l", ['k"l']),
90
+ ("/ ", [' ']),
91
+ ("/m~0n", ['m~n']),
92
+ ('/\xee', ['\xee']),
93
+ ]
94
+ for path in paths:
95
+ ptr = JsonPointer(path[0])
96
+ self.assertEqual(ptr.get_parts(), path[1])
97
+
98
99
class ComparisonTests(unittest.TestCase):
100
0 commit comments