<s> """<STR_LIT>""" <EOL> import datetime <EOL> from testcases import common <EOL> class TestCase ( common . TestCase ) : <EOL> def testBacktestingLog1 ( self ) : <EOL> code = """<STR_LIT>""" <EOL> res = common . run_python_code ( code ) <EOL> expectedLines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] <EOL> self . assertEqual ( res . get_output_lines ( ) , expectedLines ) <EOL> self . assertTrue ( res . exit_ok ( ) ) <EOL> def testBacktestingLog2 ( self ) : <EOL> code = """<STR_LIT>""" <EOL> res = common . run_python_code ( code ) <EOL> self . assertEqual ( len ( res . get_output_lines ( ) ) , <NUM_LIT:3> ) <EOL> self . assertEqual ( res . get_output_lines ( ) [ <NUM_LIT:0> ] , "<STR_LIT>" ) <EOL> self . assertEqual ( <EOL> res . get_output_lines ( ) [ <NUM_LIT:1> ] , <EOL> "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( res . get_output_lines ( ) [ <NUM_LIT:2> ] , "<STR_LIT>" ) <EOL> self . assertTrue ( res . exit_ok ( ) ) <EOL> def testNonBacktestingLog3 ( self ) : <EOL> code = """<STR_LIT>""" <EOL> res = common . run_python_code ( code ) <EOL> now = datetime . datetime . now ( ) <EOL> self . assertEqual ( len ( res . get_output_lines ( ) ) , <NUM_LIT:2> ) <EOL> for line in res . get_output_lines ( True ) : <EOL> self . assertEqual ( line . find ( str ( now . date ( ) ) ) , <NUM_LIT:0> ) <EOL> self . assertNotEqual ( res . get_output_lines ( ) [ <NUM_LIT:0> ] . find ( "<STR_LIT>" ) , - <NUM_LIT:1> ) <EOL> self . assertNotEqual ( res . get_output_lines ( ) [ <NUM_LIT:1> ] . find ( "<STR_LIT>" ) , - <NUM_LIT:1> ) <EOL> self . assertTrue ( res . exit_ok ( ) ) </s>
