@@ -303,59 +303,34 @@ def test_kill_cursors(self):
303
303
db = self .db
304
304
db .drop_collection ("test" )
305
305
306
- client_cursors = db .command ("cursorInfo" )["clientCursors_size" ]
307
- by_location = db .command ("cursorInfo" )["byLocation_size" ]
306
+ c = db .command ("cursorInfo" )["clientCursors_size" ]
308
307
309
308
test = db .test
310
309
for i in range (10000 ):
311
310
test .insert ({"i" : i })
312
-
313
- self .assertEqual (client_cursors ,
314
- db .command ("cursorInfo" )["clientCursors_size" ])
315
- self .assertEqual (by_location ,
316
- db .command ("cursorInfo" )["byLocation_size" ])
311
+ self .assertEqual (c , db .command ("cursorInfo" )["clientCursors_size" ])
317
312
318
313
for _ in range (10 ):
319
314
db .test .find_one ()
320
-
321
- self .assertEqual (client_cursors ,
322
- db .command ("cursorInfo" )["clientCursors_size" ])
323
- self .assertEqual (by_location ,
324
- db .command ("cursorInfo" )["byLocation_size" ])
315
+ self .assertEqual (c , db .command ("cursorInfo" )["clientCursors_size" ])
325
316
326
317
for _ in range (10 ):
327
318
for x in db .test .find ():
328
319
break
329
-
330
- self .assertEqual (client_cursors ,
331
- db .command ("cursorInfo" )["clientCursors_size" ])
332
- self .assertEqual (by_location ,
333
- db .command ("cursorInfo" )["byLocation_size" ])
320
+ self .assertEqual (c , db .command ("cursorInfo" )["clientCursors_size" ])
334
321
335
322
a = db .test .find ()
336
323
for x in a :
337
324
break
338
-
339
- self .assertNotEqual (client_cursors ,
340
- db .command ("cursorInfo" )["clientCursors_size" ])
341
- self .assertNotEqual (by_location ,
342
- db .command ("cursorInfo" )["byLocation_size" ])
325
+ self .assertNotEqual (c , db .command ("cursorInfo" )["clientCursors_size" ])
343
326
344
327
del a
345
-
346
- self .assertEqual (client_cursors ,
347
- db .command ("cursorInfo" )["clientCursors_size" ])
348
- self .assertEqual (by_location ,
349
- db .command ("cursorInfo" )["byLocation_size" ])
328
+ self .assertEqual (c , db .command ("cursorInfo" )["clientCursors_size" ])
350
329
351
330
a = db .test .find ().limit (10 )
352
331
for x in a :
353
332
break
354
-
355
- self .assertEqual (client_cursors ,
356
- db .command ("cursorInfo" )["clientCursors_size" ])
357
- self .assertEqual (by_location ,
358
- db .command ("cursorInfo" )["byLocation_size" ])
333
+ self .assertEqual (c , db .command ("cursorInfo" )["clientCursors_size" ])
359
334
360
335
def test_rewind (self ):
361
336
self .db .test .save ({"x" : 1 })
0 commit comments