Skip to content

Commit e87af9c

Browse files
committed
PYTHON-5813 - Skip QE prefixPreview and suffixPreview tests on server 9.0.0+
1 parent e67931d commit e87af9c

7 files changed

Lines changed: 15 additions & 1 deletion

test/asynchronous/test_encryption.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3408,6 +3408,7 @@ async def asyncSetUp(self):
34083408
)
34093409
await coll.insert_one({"_id": 0, "encryptedText": encrypted_value})
34103410

3411+
@async_client_context.require_version_max(8, 99, 99)
34113412
async def test_01_can_find_a_document_by_prefix(self):
34123413
# Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts.
34133414
text_opts = TextOpts(
@@ -3432,6 +3433,7 @@ async def test_01_can_find_a_document_by_prefix(self):
34323433
value.pop("__safeContent__", None)
34333434
self.assertEqual(value, expected)
34343435

3436+
@async_client_context.require_version_max(8, 99, 99)
34353437
async def test_02_can_find_a_document_by_suffix(self):
34363438
# Use clientEncryption.encrypt() to encrypt the string "baz" with the following EncryptOpts:
34373439
text_opts = TextOpts(
@@ -3456,6 +3458,7 @@ async def test_02_can_find_a_document_by_suffix(self):
34563458
value.pop("__safeContent__", None)
34573459
self.assertEqual(value, expected)
34583460

3461+
@async_client_context.require_version_max(8, 99, 99)
34593462
async def test_03_no_document_found_by_prefix(self):
34603463
# Use clientEncryption.encrypt() to encrypt the string "baz" with the following EncryptOpts:
34613464
text_opts = TextOpts(
@@ -3478,6 +3481,7 @@ async def test_03_no_document_found_by_prefix(self):
34783481
# Assert that no documents are returned.
34793482
self.assertIsNone(value)
34803483

3484+
@async_client_context.require_version_max(8, 99, 99)
34813485
async def test_04_no_document_found_by_suffix(self):
34823486
# Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts:
34833487
text_opts = TextOpts(
@@ -3554,6 +3558,7 @@ async def test_06_no_document_found_by_substring(self):
35543558
# Assert that no documents are returned.
35553559
self.assertIsNone(value)
35563560

3561+
@async_client_context.require_version_max(8, 99, 99)
35573562
async def test_07_contentionFactor_is_required(self):
35583563
from pymongocrypt.errors import MongoCryptError
35593564

test/client-side-encryption/spec/unified/QE-Text-cleanupStructuredEncryptionData.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"runOnRequirements": [
55
{
66
"minServerVersion": "8.2.0",
7+
"maxServerVersion": "8.99.99",
78
"topologies": [
89
"replicaset",
910
"sharded",

test/client-side-encryption/spec/unified/QE-Text-compactStructuredEncryptionData.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"runOnRequirements": [
55
{
66
"minServerVersion": "8.2.0",
7+
"maxServerVersion": "8.99.99",
78
"topologies": [
89
"replicaset",
910
"sharded",

test/client-side-encryption/spec/unified/QE-Text-prefixPreview.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"runOnRequirements": [
55
{
66
"minServerVersion": "8.2.0",
7+
"maxServerVersion": "8.99.99",
78
"topologies": [
89
"replicaset",
910
"sharded",

test/client-side-encryption/spec/unified/QE-Text-substringPreview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
],
127127
"tests": [
128128
{
129-
"description": "Insert QE suffixPreview",
129+
"description": "Insert QE substringPreview",
130130
"operations": [
131131
{
132132
"name": "insertOne",

test/client-side-encryption/spec/unified/QE-Text-suffixPreview.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"runOnRequirements": [
55
{
66
"minServerVersion": "8.2.0",
7+
"maxServerVersion": "8.99.99",
78
"topologies": [
89
"replicaset",
910
"sharded",

test/test_encryption.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,6 +3390,7 @@ def setUp(self):
33903390
)
33913391
coll.insert_one({"_id": 0, "encryptedText": encrypted_value})
33923392

3393+
@client_context.require_version_max(8, 99, 99)
33933394
def test_01_can_find_a_document_by_prefix(self):
33943395
# Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts.
33953396
text_opts = TextOpts(
@@ -3414,6 +3415,7 @@ def test_01_can_find_a_document_by_prefix(self):
34143415
value.pop("__safeContent__", None)
34153416
self.assertEqual(value, expected)
34163417

3418+
@client_context.require_version_max(8, 99, 99)
34173419
def test_02_can_find_a_document_by_suffix(self):
34183420
# Use clientEncryption.encrypt() to encrypt the string "baz" with the following EncryptOpts:
34193421
text_opts = TextOpts(
@@ -3438,6 +3440,7 @@ def test_02_can_find_a_document_by_suffix(self):
34383440
value.pop("__safeContent__", None)
34393441
self.assertEqual(value, expected)
34403442

3443+
@client_context.require_version_max(8, 99, 99)
34413444
def test_03_no_document_found_by_prefix(self):
34423445
# Use clientEncryption.encrypt() to encrypt the string "baz" with the following EncryptOpts:
34433446
text_opts = TextOpts(
@@ -3460,6 +3463,7 @@ def test_03_no_document_found_by_prefix(self):
34603463
# Assert that no documents are returned.
34613464
self.assertIsNone(value)
34623465

3466+
@client_context.require_version_max(8, 99, 99)
34633467
def test_04_no_document_found_by_suffix(self):
34643468
# Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts:
34653469
text_opts = TextOpts(
@@ -3536,6 +3540,7 @@ def test_06_no_document_found_by_substring(self):
35363540
# Assert that no documents are returned.
35373541
self.assertIsNone(value)
35383542

3543+
@client_context.require_version_max(8, 99, 99)
35393544
def test_07_contentionFactor_is_required(self):
35403545
from pymongocrypt.errors import MongoCryptError
35413546

0 commit comments

Comments
 (0)