Skip to content

Commit

Permalink
PYTHON-3221 Resync CSFLE spec tests (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey committed Apr 13, 2022
1 parent a319075 commit ff288fa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .evergreen/resync-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ do
change*streams)
cpjson change-streams/tests/ change_streams/
;;
client-side-encryption|csfle|fle)
cpjson client-side-encryption/tests/ client-side-encryption/spec
cpjson client-side-encryption/corpus/ client-side-encryption/corpus
cpjson client-side-encryption/external/ client-side-encryption/external
cpjson client-side-encryption/limits/ client-side-encryption/limits
;;
cmap|CMAP)
cpjson connection-monitoring-and-pooling/tests cmap
rm $PYMONGO/test/cmap/wait-queue-fairness.json # PYTHON-1873
Expand Down
4 changes: 2 additions & 2 deletions test/client-side-encryption/spec/badQueries.json
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@
}
},
"result": {
"errorContains": "Cannot encrypt element of type array"
"errorContains": "Cannot encrypt element of type"
}
}
]
Expand Down Expand Up @@ -1387,7 +1387,7 @@
}
},
"result": {
"errorContains": "Cannot encrypt element of type array"
"errorContains": "Cannot encrypt element of type"
}
}
]
Expand Down
12 changes: 6 additions & 6 deletions test/client-side-encryption/spec/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
}
},
"result": {
"errorContains": "Cannot use deterministic encryption for element of type: double"
"errorContains": "element of type: double"
}
}
]
Expand Down Expand Up @@ -551,7 +551,7 @@
}
},
"result": {
"errorContains": "Cannot use deterministic encryption for element of type: decimal"
"errorContains": "element of type: decimal"
}
}
]
Expand Down Expand Up @@ -883,7 +883,7 @@
}
},
"result": {
"errorContains": "Cannot use deterministic encryption for element of type: javascriptWithScope"
"errorContains": "element of type: javascriptWithScope"
}
}
]
Expand Down Expand Up @@ -928,7 +928,7 @@
}
},
"result": {
"errorContains": "Cannot use deterministic encryption for element of type: object"
"errorContains": "element of type: object"
}
}
]
Expand Down Expand Up @@ -1547,7 +1547,7 @@
}
},
"result": {
"errorContains": "Cannot use deterministic encryption for element of type: array"
"errorContains": "element of type: array"
}
}
]
Expand Down Expand Up @@ -1592,7 +1592,7 @@
}
},
"result": {
"errorContains": "Cannot use deterministic encryption for element of type: bool"
"errorContains": "element of type: bool"
}
}
]
Expand Down
6 changes: 1 addition & 5 deletions test/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,11 +815,7 @@ def run_test(self, provider_name):
self.assertEqual(encrypted_altname, encrypted)

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

def test_data_key_local(self):
Expand Down

0 comments on commit ff288fa

Please sign in to comment.