#NEWLINE# def test_TSO_count( self ) : #NEWLINE# #INDENT# ' Tests TwitterSearchOrder.set_count() ' #NEWLINE# tso = self . getCopy ( ) #NEWLINE# correct_values = [ self . generateInt ( minimum = 1 , maximum = 100 ) for x in range ( 0 , 10 ) ] #NEWLINE# for value in correct_values : #NEWLINE# #INDENT# tso . set_count ( value ) #NEWLINE# cor = ( '%s%i' % ( self . __tso . create_search_url ( ) [ 0 : ( - 3 ) ] , correct_values ) ) #NEWLINE# self . assertEqualQuery ( tso . create_search_url ( ) , cor ) #NEWLINE# #UNINDENT# wrong_values = [ ( - 1 ) , 1.0 , 101 , '' , [ ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] #NEWLINE# for value in wrong_values : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# tso . set_count ( value ) #NEWLINE# self . assertTrue ( False , ( 'Not raising exception for %s' % value ) ) #NEWLINE# #UNINDENT# except TwitterSearchException as e : #NEWLINE# #INDENT# self . assertEqual ( e . code , 1004 , 'Wrong exception code' )