#NEWLINE# def test_cleanup( self ) : #NEWLINE# #INDENT# mock_results = [ ] #NEWLINE# for ii in range ( 0 , constants . MAX_LIMIT ) : #NEWLINE# #INDENT# mock_results . append ( TestModelFake ( ) ) #NEWLINE# #UNINDENT# fake_query = flexmock ( ) #NEWLINE# fake_query . should_receive ( 'fetch' ) . and_return ( mock_results ) #NEWLINE# mock = flexmock ( db . TestModel ) #NEWLINE# mock . should_receive ( 'all' ) . and_return ( fake_query ) #NEWLINE# db . cleanup ( )