#NEWLINE# def test_smoke( self ) : #NEWLINE# #INDENT# 'Does a complete run with mock data' #NEWLINE# business = ( BUSINESS_TEMPLATE % ( CATEGORY , BIZ_ID ) ) #NEWLINE# review = ( REVIEW_TEMPLATE % ( LONG_TEXT , BIZ_ID ) ) #NEWLINE# total_input = ( business + review ) #NEWLINE# static_stdin = StringIO ( total_input ) #NEWLINE# job = CategoryPredictor ( [ '-r' , 'inline' , '--no-conf' , '-' ] ) #NEWLINE# job . sandbox ( stdin = static_stdin ) #NEWLINE# results = [ ] #NEWLINE# with job . make_runner ( ) as runner : #NEWLINE# #INDENT# runner . run ( ) #NEWLINE# for line in runner . stream_output ( ) : #NEWLINE# #INDENT# ( key , value ) = job . parse_output_line ( line ) #NEWLINE# results . append ( value ) #NEWLINE# #UNINDENT# #UNINDENT# result = { #NEWLINE# #INDENT# CATEGORY : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( results [ 0 ] , result )