From 7a44a6b7361ca32b5cbdbf6920b9192c3f011048 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 12 Mar 2025 11:32:13 -0700 Subject: [PATCH 1/3] PYTHON-5198 Fix test_03_invalid_keyid --- test/asynchronous/test_encryption.py | 2 +- test/test_encryption.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index 000d98a111..d2a9674354 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -2984,7 +2984,7 @@ async def test_02_no_fields(self): async def test_03_invalid_keyid(self): with self.assertRaisesRegex( EncryptedCollectionError, - "create.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", + ".*.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", ): await self.client_encryption.create_encrypted_collection( database=self.db, diff --git a/test/test_encryption.py b/test/test_encryption.py index 6efb167442..f9ebea540a 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -2966,7 +2966,7 @@ def test_02_no_fields(self): def test_03_invalid_keyid(self): with self.assertRaisesRegex( EncryptedCollectionError, - "create.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", + ".*.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", ): self.client_encryption.create_encrypted_collection( database=self.db, From a20f59f29dd91d655d31c385fd4a9f591e1b52d4 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 12 Mar 2025 12:19:22 -0700 Subject: [PATCH 2/3] PYTHON-5198 Less permissive --- test/asynchronous/test_encryption.py | 2 +- test/test_encryption.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index d2a9674354..4e53221681 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -2984,7 +2984,7 @@ async def test_02_no_fields(self): async def test_03_invalid_keyid(self): with self.assertRaisesRegex( EncryptedCollectionError, - ".*.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", + "(create|checkAuthForCreateCollection).encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", ): await self.client_encryption.create_encrypted_collection( database=self.db, diff --git a/test/test_encryption.py b/test/test_encryption.py index f9ebea540a..5b7cf0587a 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -2966,7 +2966,7 @@ def test_02_no_fields(self): def test_03_invalid_keyid(self): with self.assertRaisesRegex( EncryptedCollectionError, - ".*.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", + "(create|checkAuthForCreateCollection).encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", ): self.client_encryption.create_encrypted_collection( database=self.db, From e89f2f3d9c01aa2f237da69aa0d3e4c1f3c8cd57 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 12 Mar 2025 12:24:24 -0700 Subject: [PATCH 3/3] PYTHON-5198 Comment --- test/asynchronous/test_encryption.py | 1 + test/test_encryption.py | 1 + 2 files changed, 2 insertions(+) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index 4e53221681..728a6f9139 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -2982,6 +2982,7 @@ async def test_02_no_fields(self): ) async def test_03_invalid_keyid(self): + # checkAuthForCreateCollection can be removed when SERVER-102101 is fixed. with self.assertRaisesRegex( EncryptedCollectionError, "(create|checkAuthForCreateCollection).encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData", diff --git a/test/test_encryption.py b/test/test_encryption.py index 5b7cf0587a..36c0ab0e24 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -2964,6 +2964,7 @@ def test_02_no_fields(self): ) def test_03_invalid_keyid(self): + # checkAuthForCreateCollection can be removed when SERVER-102101 is fixed. with self.assertRaisesRegex( EncryptedCollectionError, "(create|checkAuthForCreateCollection).encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData",