File tree Expand file tree Collapse file tree 4 files changed +27
-67
lines changed Expand file tree Collapse file tree 4 files changed +27
-67
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,14 @@ async def test_change_operations(self):
410410 expected_update_description = {"updatedFields" : {"new" : 1 }, "removedFields" : ["foo" ]}
411411 if async_client_context .version .at_least (4 , 5 , 0 ):
412412 expected_update_description ["truncatedArrays" ] = []
413- self .assertEqual (expected_update_description , change ["updateDescription" ])
413+ self .assertEqual (
414+ expected_update_description ,
415+ {
416+ k : v
417+ for k , v in change ["updateDescription" ].items ()
418+ if k in expected_update_description
419+ },
420+ )
414421 # Replace.
415422 await self .watched_collection ().replace_one ({"new" : 1 }, {"foo" : "bar" })
416423 change = await change_stream .next ()
Original file line number Diff line number Diff line change 4242 }
4343 ],
4444 "tests" : [
45- {
46- "description" : " disambiguatedPaths is not present when showExpandedEvents is false/unset" ,
47- "operations" : [
48- {
49- "name" : " insertOne" ,
50- "object" : " collection0" ,
51- "arguments" : {
52- "document" : {
53- "_id" : 1 ,
54- "a" : {
55- "1" : 1
56- }
57- }
58- }
59- },
60- {
61- "name" : " createChangeStream" ,
62- "object" : " collection0" ,
63- "arguments" : {
64- "pipeline" : []
65- },
66- "saveResultAsEntity" : " changeStream0"
67- },
68- {
69- "name" : " updateOne" ,
70- "object" : " collection0" ,
71- "arguments" : {
72- "filter" : {
73- "_id" : 1
74- },
75- "update" : {
76- "$set" : {
77- "a.1" : 2
78- }
79- }
80- }
81- },
82- {
83- "name" : " iterateUntilDocumentOrError" ,
84- "object" : " changeStream0" ,
85- "expectResult" : {
86- "operationType" : " update" ,
87- "ns" : {
88- "db" : " database0" ,
89- "coll" : " collection0"
90- },
91- "updateDescription" : {
92- "updatedFields" : {
93- "$$exists" : true
94- },
95- "removedFields" : {
96- "$$exists" : true
97- },
98- "truncatedArrays" : {
99- "$$exists" : true
100- },
101- "disambiguatedPaths" : {
102- "$$exists" : false
103- }
104- }
105- }
106- }
107- ]
108- },
10945 {
11046 "description" : " disambiguatedPaths is present on updateDescription when an ambiguous path is present" ,
11147 "operations" : [
Original file line number Diff line number Diff line change 181181 "field" : " array" ,
182182 "newSize" : 2
183183 }
184- ]
184+ ],
185+ "disambiguatedPaths" : {
186+ "$$unsetOrMatches" : {
187+ "$$exists" : true
188+ }
189+ }
185190 }
186191 }
187192 }
14081413 "$$unsetOrMatches" : {
14091414 "$$exists" : true
14101415 }
1416+ },
1417+ "disambiguatedPaths" : {
1418+ "$$unsetOrMatches" : {
1419+ "$$exists" : true
1420+ }
14111421 }
14121422 }
14131423 }
Original file line number Diff line number Diff line change @@ -406,7 +406,14 @@ def test_change_operations(self):
406406 expected_update_description = {"updatedFields" : {"new" : 1 }, "removedFields" : ["foo" ]}
407407 if client_context .version .at_least (4 , 5 , 0 ):
408408 expected_update_description ["truncatedArrays" ] = []
409- self .assertEqual (expected_update_description , change ["updateDescription" ])
409+ self .assertEqual (
410+ expected_update_description ,
411+ {
412+ k : v
413+ for k , v in change ["updateDescription" ].items ()
414+ if k in expected_update_description
415+ },
416+ )
410417 # Replace.
411418 self .watched_collection ().replace_one ({"new" : 1 }, {"foo" : "bar" })
412419 change = change_stream .next ()
You can’t perform that action at this time.
0 commit comments