Skip to content

Commit e27601e

Browse files
committed
PYTHON-3221 Resync CSFLE spec tests (#929)
(cherry picked from commit ff288fa)
1 parent bc03c34 commit e27601e

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

test/client-side-encryption/spec/badQueries.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@
13181318
}
13191319
},
13201320
"result": {
1321-
"errorContains": "Cannot encrypt element of type array"
1321+
"errorContains": "Cannot encrypt element of type"
13221322
}
13231323
}
13241324
]
@@ -1387,7 +1387,7 @@
13871387
}
13881388
},
13891389
"result": {
1390-
"errorContains": "Cannot encrypt element of type array"
1390+
"errorContains": "Cannot encrypt element of type"
13911391
}
13921392
}
13931393
]

test/client-side-encryption/spec/types.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@
504504
}
505505
},
506506
"result": {
507-
"errorContains": "Cannot use deterministic encryption for element of type: double"
507+
"errorContains": "element of type: double"
508508
}
509509
}
510510
]
@@ -551,7 +551,7 @@
551551
}
552552
},
553553
"result": {
554-
"errorContains": "Cannot use deterministic encryption for element of type: decimal"
554+
"errorContains": "element of type: decimal"
555555
}
556556
}
557557
]
@@ -883,7 +883,7 @@
883883
}
884884
},
885885
"result": {
886-
"errorContains": "Cannot use deterministic encryption for element of type: javascriptWithScope"
886+
"errorContains": "element of type: javascriptWithScope"
887887
}
888888
}
889889
]
@@ -928,7 +928,7 @@
928928
}
929929
},
930930
"result": {
931-
"errorContains": "Cannot use deterministic encryption for element of type: object"
931+
"errorContains": "element of type: object"
932932
}
933933
}
934934
]
@@ -1547,7 +1547,7 @@
15471547
}
15481548
},
15491549
"result": {
1550-
"errorContains": "Cannot use deterministic encryption for element of type: array"
1550+
"errorContains": "element of type: array"
15511551
}
15521552
}
15531553
]
@@ -1592,7 +1592,7 @@
15921592
}
15931593
},
15941594
"result": {
1595-
"errorContains": "Cannot use deterministic encryption for element of type: bool"
1595+
"errorContains": "element of type: bool"
15961596
}
15971597
}
15981598
]

test/test_encryption.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,7 @@ def run_test(self, provider_name):
748748
self.assertEqual(encrypted_altname, encrypted)
749749

750750
# Explicitly encrypting an auto encrypted field.
751-
msg = (
752-
r"Cannot encrypt element of type binData because schema "
753-
r"requires that type is one of: \[ string \]"
754-
)
755-
with self.assertRaisesRegex(EncryptionError, msg):
751+
with self.assertRaisesRegex(EncryptionError, r"encrypt element of type"):
756752
self.client_encrypted.db.coll.insert_one({"encrypted_placeholder": encrypted})
757753

758754
def test_data_key_local(self):

0 commit comments

Comments
 (0)