#NEWLINE# def test_insert_iterables( self ) : #NEWLINE# #INDENT# db = self . db #NEWLINE# self . assertRaises ( TypeError , db . test . insert , 4 ) #NEWLINE# self . assertRaises ( TypeError , db . test . insert , None ) #NEWLINE# self . assertRaises ( TypeError , db . test . insert , True ) #NEWLINE# db . drop_collection ( 'test' ) #NEWLINE# self . assertEqual ( db . test . find ( ) . count ( ) , 0 ) #NEWLINE# db . test . insert ( ( { #NEWLINE# #INDENT# 'hello' : u ( 'world' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'hello' : u ( 'world' ) , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEqual ( db . test . find ( ) . count ( ) , 2 ) #NEWLINE# db . drop_collection ( 'test' ) #NEWLINE# self . assertEqual ( db . test . find ( ) . count ( ) , 0 ) #NEWLINE# db . test . insert ( map ( ( lambda x : { #NEWLINE# #INDENT# 'hello' : 'world' , #NEWLINE# #UNINDENT# } ) , itertools . repeat ( None , 10 ) ) ) #NEWLINE# self . assertEqual ( db . test . find ( ) . count ( ) , 10 )