#NEWLINE# def test_safe_update( self ) : #NEWLINE# #INDENT# self . db . drop_collection ( 'test1' ) #NEWLINE# self . db . test1 . insert_one ( { #NEWLINE# #INDENT# 'test' : 'update' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db . test1 . insert_one ( { #NEWLINE# #INDENT# 'test' : 'unique' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db . drop_collection ( 'test2' ) #NEWLINE# self . db . test2 . insert_one ( { #NEWLINE# #INDENT# 'test' : 'update' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db . test2 . insert_one ( { #NEWLINE# #INDENT# 'test' : 'unique' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . db . test2 . create_index ( 'test' , unique = True ) #NEWLINE# self . db . test2 . find_one ( ) #NEWLINE# okay = Update ( self . db . test1 , 2000 , False ) #NEWLINE# error = Update ( self . db . test2 , 2000 , True ) #NEWLINE# error . start ( ) #NEWLINE# okay . start ( ) #NEWLINE# error . join ( ) #NEWLINE# okay . join ( )