PYTHON-3274 Add commandStartedEvent assertions to clustered index spec tests (#1022)

This commit is contained in:
Steven Silvester 2022-07-27 18:28:23 -05:00 committed by GitHub
parent 864812d400
commit e96f112d84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,14 +10,17 @@
"createEntities": [
{
"client": {
"id": "client0"
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "ts-tests"
"databaseName": "ci-tests"
}
},
{
@ -31,7 +34,7 @@
"initialData": [
{
"collectionName": "test",
"databaseName": "ts-tests",
"databaseName": "ci-tests",
"documents": []
}
],
@ -64,10 +67,40 @@
"name": "assertCollectionExists",
"object": "testRunner",
"arguments": {
"databaseName": "ts-tests",
"databaseName": "ci-tests",
"collectionName": "test"
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"drop": "test"
},
"databaseName": "ci-tests"
}
},
{
"commandStartedEvent": {
"command": {
"create": "test",
"clusteredIndex": {
"key": {
"_id": 1
},
"unique": true,
"name": "test index"
}
},
"databaseName": "ci-tests"
}
}
]
}
]
},
{
@ -125,6 +158,49 @@
}
]
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"drop": "test"
},
"databaseName": "ci-tests"
}
},
{
"commandStartedEvent": {
"command": {
"create": "test",
"clusteredIndex": {
"key": {
"_id": 1
},
"unique": true,
"name": "test index"
}
},
"databaseName": "ci-tests"
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1,
"filter": {
"name": {
"$eq": "test"
}
}
},
"databaseName": "ci-tests"
}
}
]
}
]
},
{
@ -171,6 +247,44 @@
}
]
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"drop": "test"
},
"databaseName": "ci-tests"
}
},
{
"commandStartedEvent": {
"command": {
"create": "test",
"clusteredIndex": {
"key": {
"_id": 1
},
"unique": true,
"name": "test index"
}
},
"databaseName": "ci-tests"
}
},
{
"commandStartedEvent": {
"command": {
"listIndexes": "test"
},
"databaseName": "ci-tests"
}
}
]
}
]
}
]