Skip to content

Commit e96f112

Browse files
authored
PYTHON-3274 Add commandStartedEvent assertions to clustered index spec tests (#1022)
1 parent 864812d commit e96f112

File tree

1 file changed

+118
-4
lines changed

1 file changed

+118
-4
lines changed

test/collection_management/clustered-indexes.json

Lines changed: 118 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
"createEntities": [
1111
{
1212
"client": {
13-
"id": "client0"
13+
"id": "client0",
14+
"observeEvents": [
15+
"commandStartedEvent"
16+
]
1417
}
1518
},
1619
{
1720
"database": {
1821
"id": "database0",
1922
"client": "client0",
20-
"databaseName": "ts-tests"
23+
"databaseName": "ci-tests"
2124
}
2225
},
2326
{
@@ -31,7 +34,7 @@
3134
"initialData": [
3235
{
3336
"collectionName": "test",
34-
"databaseName": "ts-tests",
37+
"databaseName": "ci-tests",
3538
"documents": []
3639
}
3740
],
@@ -64,10 +67,40 @@
6467
"name": "assertCollectionExists",
6568
"object": "testRunner",
6669
"arguments": {
67-
"databaseName": "ts-tests",
70+
"databaseName": "ci-tests",
6871
"collectionName": "test"
6972
}
7073
}
74+
],
75+
"expectEvents": [
76+
{
77+
"client": "client0",
78+
"events": [
79+
{
80+
"commandStartedEvent": {
81+
"command": {
82+
"drop": "test"
83+
},
84+
"databaseName": "ci-tests"
85+
}
86+
},
87+
{
88+
"commandStartedEvent": {
89+
"command": {
90+
"create": "test",
91+
"clusteredIndex": {
92+
"key": {
93+
"_id": 1
94+
},
95+
"unique": true,
96+
"name": "test index"
97+
}
98+
},
99+
"databaseName": "ci-tests"
100+
}
101+
}
102+
]
103+
}
71104
]
72105
},
73106
{
@@ -125,6 +158,49 @@
125158
}
126159
]
127160
}
161+
],
162+
"expectEvents": [
163+
{
164+
"client": "client0",
165+
"events": [
166+
{
167+
"commandStartedEvent": {
168+
"command": {
169+
"drop": "test"
170+
},
171+
"databaseName": "ci-tests"
172+
}
173+
},
174+
{
175+
"commandStartedEvent": {
176+
"command": {
177+
"create": "test",
178+
"clusteredIndex": {
179+
"key": {
180+
"_id": 1
181+
},
182+
"unique": true,
183+
"name": "test index"
184+
}
185+
},
186+
"databaseName": "ci-tests"
187+
}
188+
},
189+
{
190+
"commandStartedEvent": {
191+
"command": {
192+
"listCollections": 1,
193+
"filter": {
194+
"name": {
195+
"$eq": "test"
196+
}
197+
}
198+
},
199+
"databaseName": "ci-tests"
200+
}
201+
}
202+
]
203+
}
128204
]
129205
},
130206
{
@@ -171,6 +247,44 @@
171247
}
172248
]
173249
}
250+
],
251+
"expectEvents": [
252+
{
253+
"client": "client0",
254+
"events": [
255+
{
256+
"commandStartedEvent": {
257+
"command": {
258+
"drop": "test"
259+
},
260+
"databaseName": "ci-tests"
261+
}
262+
},
263+
{
264+
"commandStartedEvent": {
265+
"command": {
266+
"create": "test",
267+
"clusteredIndex": {
268+
"key": {
269+
"_id": 1
270+
},
271+
"unique": true,
272+
"name": "test index"
273+
}
274+
},
275+
"databaseName": "ci-tests"
276+
}
277+
},
278+
{
279+
"commandStartedEvent": {
280+
"command": {
281+
"listIndexes": "test"
282+
},
283+
"databaseName": "ci-tests"
284+
}
285+
}
286+
]
287+
}
174288
]
175289
}
176290
]

0 commit comments

Comments
 (0)