@@ -471,6 +471,31 @@ def test_command(self):
471
471
ctx .exit ()
472
472
473
473
# Obedient commands.
474
+ # Geo stuff.
475
+ self .c .pymongo_test .test .create_index ([('location' , '2d' )])
476
+
477
+ self .c .pymongo_test .test .create_index ([('location' , 'geoHaystack' ),
478
+ ('key' , 1 )], bucketSize = 100 )
479
+
480
+ # Attempt to await replication of indexes replicated.
481
+ self .c .pymongo_test .test2 .insert ({}, w = self .w )
482
+ self .c .pymongo_test .test2 .remove ({}, w = self .w )
483
+
484
+ self ._test_fn (True , lambda : self .c .pymongo_test .command (
485
+ 'geoNear' , 'test' , near = [0 , 0 ]))
486
+ self ._test_fn (True , lambda : self .c .pymongo_test .command (SON ([
487
+ ('geoNear' , 'test' ), ('near' , [0 , 0 ])])))
488
+
489
+ self ._test_fn (
490
+ True , lambda : self .c .pymongo_test .command (
491
+ 'geoSearch' , 'test' , near = [33 , 33 ], maxDistance = 6 ,
492
+ search = {'type' : 'restaurant' }, limit = 30 ))
493
+
494
+ self ._test_fn (
495
+ True , lambda : self .c .pymongo_test .command (SON ([
496
+ ('geoSearch' , 'test' ), ('near' , [33 , 33 ]), ('maxDistance' , 6 ),
497
+ ('search' , {'type' : 'restaurant' }), ('limit' , 30 )])))
498
+
474
499
self ._test_fn (True , lambda : self .c .pymongo_test .command ('group' , {
475
500
'ns' : 'test' , 'key' : {'a' : 1 }, '$reduce' : 'function(obj, prev) { }' ,
476
501
'initial' : {}}))
@@ -498,31 +523,6 @@ def test_command(self):
498
523
self ._test_fn (True , lambda : self .c .pymongo_test .command (SON ([
499
524
('distinct' , 'test' ), ('key' , 'a' ), ('query' , {'a' : 1 })])))
500
525
501
- # Geo stuff.
502
- self .c .pymongo_test .test .create_index ([('location' , '2d' )])
503
-
504
- self .c .pymongo_test .test .create_index ([('location' , 'geoHaystack' ),
505
- ('key' , 1 )], bucketSize = 100 )
506
-
507
- # Attempt to await replication of indexes replicated.
508
- self .c .pymongo_test .test2 .insert ({}, w = self .w )
509
- self .c .pymongo_test .test2 .remove ({}, w = self .w )
510
-
511
- self ._test_fn (True , lambda : self .c .pymongo_test .command (
512
- 'geoNear' , 'test' , near = [0 , 0 ]))
513
- self ._test_fn (True , lambda : self .c .pymongo_test .command (SON ([
514
- ('geoNear' , 'test' ), ('near' , [0 , 0 ])])))
515
-
516
- self ._test_fn (
517
- True , lambda : self .c .pymongo_test .command (
518
- 'geoSearch' , 'test' , near = [33 , 33 ], maxDistance = 6 ,
519
- search = {'type' : 'restaurant' }, limit = 30 ))
520
-
521
- self ._test_fn (
522
- True , lambda : self .c .pymongo_test .command (SON ([
523
- ('geoSearch' , 'test' ), ('near' , [33 , 33 ]), ('maxDistance' , 6 ),
524
- ('search' , {'type' : 'restaurant' }), ('limit' , 30 )])))
525
-
526
526
if (version .at_least (self .c , (2 , 1 , 0 )) and
527
527
not version .at_least (self .c , (3 , 5 , 1 ))):
528
528
self ._test_fn (
0 commit comments