Skip to content

Commit 6569933

Browse files
PYTHON-2376 Fix change stream test failures due to new updateDescription.truncatedArrays field in changeEvent documents (#489)
1 parent 8afbc64 commit 6569933

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/test_change_stream.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,13 @@ def test_change_operations(self):
367367
self.assertEqual(change['operationType'], 'update')
368368
self.assertEqual(change['ns'], expected_ns)
369369
self.assertNotIn('fullDocument', change)
370-
self.assertEqual({'updatedFields': {'new': 1},
371-
'removedFields': ['foo']},
370+
371+
expected_update_description = {
372+
'updatedFields': {'new': 1},
373+
'removedFields': ['foo']}
374+
if client_context.version.at_least(4, 5, 0):
375+
expected_update_description['truncatedArrays'] = []
376+
self.assertEqual(expected_update_description,
372377
change['updateDescription'])
373378
# Replace.
374379
self.watched_collection().replace_one({'new': 1}, {'foo': 'bar'})

0 commit comments

Comments
 (0)