@@ -95,18 +95,18 @@ def check_cases(self, test_cases):
95
95
if isinstance (target , list ):
96
96
assert [r .value for r in result ] == target
97
97
elif isinstance (target , set ):
98
- assert { r .value for r in result } == target
98
+ assert set ([ r .value for r in result ]) == target
99
99
else :
100
100
assert result .value == target
101
101
102
102
def test_fields_value (self ):
103
103
jsonpath .auto_id_field = None
104
104
self .check_cases ([ ('foo' , {'foo' : 'baz' }, ['baz' ]),
105
105
('foo,baz' , {'foo' : 1 , 'baz' : 2 }, [1 , 2 ]),
106
- ('*' , {'foo' : 1 , 'baz' : 2 }, { 1 , 2 } ) ])
106
+ ('*' , {'foo' : 1 , 'baz' : 2 }, set ([ 1 , 2 ]) ) ])
107
107
108
108
jsonpath .auto_id_field = 'id'
109
- self .check_cases ([ ('*' , {'foo' : 1 , 'baz' : 2 }, { 1 , 2 , '@' } ) ])
109
+ self .check_cases ([ ('*' , {'foo' : 1 , 'baz' : 2 }, set ([ 1 , 2 , '@' ]) ) ])
110
110
111
111
def test_index_value (self ):
112
112
self .check_cases ([
@@ -154,18 +154,18 @@ def check_paths(self, test_cases):
154
154
if isinstance (target , list ):
155
155
assert [str (r .full_path ) for r in result ] == target
156
156
elif isinstance (target , set ):
157
- assert { str (r .full_path ) for r in result } == target
157
+ assert set ([ str (r .full_path ) for r in result ]) == target
158
158
else :
159
159
assert str (result .path ) == target
160
160
161
161
def test_fields_paths (self ):
162
162
jsonpath .auto_id_field = None
163
163
self .check_paths ([ ('foo' , {'foo' : 'baz' }, ['foo' ]),
164
164
('foo,baz' , {'foo' : 1 , 'baz' : 2 }, ['foo' , 'baz' ]),
165
- ('*' , {'foo' : 1 , 'baz' : 2 }, { 'foo' , 'baz' } ) ])
165
+ ('*' , {'foo' : 1 , 'baz' : 2 }, set ([ 'foo' , 'baz' ]) ) ])
166
166
167
167
jsonpath .auto_id_field = 'id'
168
- self .check_paths ([ ('*' , {'foo' : 1 , 'baz' : 2 }, { 'foo' , 'baz' , 'id' } ) ])
168
+ self .check_paths ([ ('*' , {'foo' : 1 , 'baz' : 2 }, set ([ 'foo' , 'baz' , 'id' ]) ) ])
169
169
170
170
def test_index_paths (self ):
171
171
self .check_paths ([('[0]' , [42 ], ['[0]' ]),
@@ -195,7 +195,7 @@ def test_fields_auto_id(self):
195
195
('*.id' ,
196
196
{'foo' :{'id' : 1 },
197
197
'baz' : 2 },
198
- { '1' , 'baz' } ) ])
198
+ set ([ '1' , 'baz' ]) ) ])
199
199
200
200
def test_index_auto_id (self ):
201
201
jsonpath .auto_id_field = "id"
0 commit comments