Skip to content

Commit ff288fa

Browse files
authored
PYTHON-3221 Resync CSFLE spec tests (#929)
1 parent a319075 commit ff288fa

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

.evergreen/resync-specs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ do
8181
change*streams)
8282
cpjson change-streams/tests/ change_streams/
8383
;;
84+
client-side-encryption|csfle|fle)
85+
cpjson client-side-encryption/tests/ client-side-encryption/spec
86+
cpjson client-side-encryption/corpus/ client-side-encryption/corpus
87+
cpjson client-side-encryption/external/ client-side-encryption/external
88+
cpjson client-side-encryption/limits/ client-side-encryption/limits
89+
;;
8490
cmap|CMAP)
8591
cpjson connection-monitoring-and-pooling/tests cmap
8692
rm $PYMONGO/test/cmap/wait-queue-fairness.json # PYTHON-1873

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
@@ -815,11 +815,7 @@ def run_test(self, provider_name):
815815
self.assertEqual(encrypted_altname, encrypted)
816816

817817
# Explicitly encrypting an auto encrypted field.
818-
msg = (
819-
r"Cannot encrypt element of type binData because schema "
820-
r"requires that type is one of: \[ string \]"
821-
)
822-
with self.assertRaisesRegex(EncryptionError, msg):
818+
with self.assertRaisesRegex(EncryptionError, r"encrypt element of type"):
823819
self.client_encrypted.db.coll.insert_one({"encrypted_placeholder": encrypted})
824820

825821
def test_data_key_local(self):

0 commit comments

Comments
 (0)