@@ -162,6 +162,11 @@ def test_descendants_value(self):
162
162
('foo..baz' , {'foo' : [{'baz' : 1 }, {'baz' : 2 }]}, [1 , 2 ] ),
163
163
])
164
164
165
+ def test_union_value (self ):
166
+ self .check_cases ([
167
+ ('foo | bar' , {'foo' : 1 , 'bar' : 2 }, [1 , 2 ])
168
+ ])
169
+
165
170
def test_parent_value (self ):
166
171
self .check_cases ([('foo.baz.`parent`' , {'foo' : {'baz' : 3 }}, [{'baz' : 3 }]),
167
172
('foo.`parent`.foo.baz.`parent`.baz.bizzle' , {'foo' : {'baz' : {'bizzle' : 5 }}}, [5 ])])
@@ -328,6 +333,11 @@ def test_update_child(self):
328
333
({'foo' : {'bar' : 1 }}, 'foo.bar' , 'baz' , {'foo' : {'bar' : 'baz' }})
329
334
])
330
335
336
+ def test_update_union (self ):
337
+ self .check_update_cases ([
338
+ ({'foo' : 1 , 'bar' : 2 }, 'foo | bar' , 3 , {'foo' : 3 , 'bar' : 3 })
339
+ ])
340
+
331
341
def test_update_where (self ):
332
342
self .check_update_cases ([
333
343
({'foo' : {'bar' : {'baz' : 1 }}, 'bar' : {'baz' : 2 }},
@@ -426,6 +436,12 @@ def test_delete_descendants_where(self):
426
436
{'foo' : {'flag' : 1 }, 'baz' : {'bar' : 2 }})
427
437
])
428
438
439
+ def test_delete_union (self ):
440
+ self .check_delete_cases ([
441
+ ({'foo' : 1 , 'bar' : 2 }, 'foo | bar' , {}),
442
+ ({'foo' : 1 , 'bar' : 2 , 'baz' : 3 }, 'foo | bar' , {'baz' : 3 }),
443
+ ])
444
+
429
445
def test_delete_index (self ):
430
446
self .check_delete_cases ([
431
447
([42 ], '[0]' , []),
0 commit comments