File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,31 @@ def test_round_trip(self):
7070 ptr = JsonPointer (path )
7171 self .assertEqual (path , ptr .path )
7272
73- parts = ptr .parts
73+ parts = ptr .get_parts ()
74+ self .assertEqual (parts , ptr .parts )
7475 new_ptr = JsonPointer .from_parts (parts )
7576 self .assertEqual (ptr , new_ptr )
7677
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+
7798
7899class ComparisonTests (unittest .TestCase ):
79100
You can’t perform that action at this time.
0 commit comments