mongo-python-driver/test/versioned-api/test-commands-strict-mode.json
Shane Harvey cd823c8ed1
PYTHON-2600 Resync spec tests for versioned api (#599)
Also resolves PYTHON-2599 and PYTHON-2641.
2021-04-23 15:11:35 -07:00

75 lines
1.6 KiB
JSON

{
"description": "Test commands: strict mode",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.9",
"serverParameters": {
"enableTestCommands": true
}
}
],
"createEntities": [
{
"client": {
"id": "client",
"observeEvents": [
"commandStartedEvent"
],
"serverApi": {
"version": "1",
"strict": true
}
}
},
{
"database": {
"id": "database",
"client": "client",
"databaseName": "versioned-api-tests"
}
}
],
"tests": [
{
"description": "Running a command that is not part of the versioned API results in an error",
"operations": [
{
"name": "runCommand",
"object": "database",
"arguments": {
"commandName": "testVersion2",
"command": {
"testVersion2": 1
}
},
"expectError": {
"isError": true,
"errorContains": "command testVersion2 is not in API Version 1",
"errorCodeName": "APIStrictError"
}
}
],
"expectEvents": [
{
"client": "client",
"events": [
{
"commandStartedEvent": {
"command": {
"testVersion2": 1,
"apiVersion": "1",
"apiStrict": true,
"apiDeprecationErrors": {
"$$unsetOrMatches": false
}
}
}
}
]
}
]
}
]
}