@@ -881,48 +881,6 @@ def test_delete(self):
881
881
db .test .delete_many ({})
882
882
self .assertFalse (db .test .find_one ())
883
883
884
- @client_context .require_no_auth
885
- @client_context .require_version_max (4 , 1 , 0 )
886
- def test_system_js (self ):
887
- db = self .client .pymongo_test
888
- db .system .js .delete_many ({})
889
-
890
- self .assertEqual (0 , db .system .js .count_documents ({}))
891
- db .system_js .add = "function(a, b) { return a + b; }"
892
- self .assertEqual ('add' , db .system .js .find_one ()['_id' ])
893
- self .assertEqual (1 , db .system .js .count_documents ({}))
894
- self .assertEqual (6 , db .system_js .add (1 , 5 ))
895
- del db .system_js .add
896
- self .assertEqual (0 , db .system .js .count_documents ({}))
897
-
898
- db .system_js ['add' ] = "function(a, b) { return a + b; }"
899
- self .assertEqual ('add' , db .system .js .find_one ()['_id' ])
900
- self .assertEqual (1 , db .system .js .count_documents ({}))
901
- self .assertEqual (6 , db .system_js ['add' ](1 , 5 ))
902
- del db .system_js ['add' ]
903
- self .assertEqual (0 , db .system .js .count_documents ({}))
904
- self .assertRaises (OperationFailure , db .system_js .add , 1 , 5 )
905
-
906
- # TODO right now CodeWScope doesn't work w/ system js
907
- # db.system_js.scope = Code("return hello;", {"hello": 8})
908
- # self.assertEqual(8, db.system_js.scope())
909
-
910
- self .assertRaises (OperationFailure , db .system_js .non_existant )
911
-
912
- def test_system_js_list (self ):
913
- db = self .client .pymongo_test
914
- db .system .js .delete_many ({})
915
- self .assertEqual ([], db .system_js .list ())
916
-
917
- db .system_js .foo = "function() { return 'blah'; }"
918
- self .assertEqual (["foo" ], db .system_js .list ())
919
-
920
- db .system_js .bar = "function() { return 'baz'; }"
921
- self .assertEqual (set (["foo" , "bar" ]), set (db .system_js .list ()))
922
-
923
- del db .system_js .foo
924
- self .assertEqual (["bar" ], db .system_js .list ())
925
-
926
884
def test_command_response_without_ok (self ):
927
885
# Sometimes (SERVER-10891) the server's response to a badly-formatted
928
886
# command document will have no 'ok' field. We should raise
0 commit comments