<s> from __future__ import print_function <EOL> import tempfile <EOL> import sys <EOL> from six . moves import StringIO <EOL> from blocks . config import config <EOL> from reverse_words import main <EOL> def test_reverse_words ( ) : <EOL> old_limit = config . recursion_limit <EOL> config . recursion_limit = <NUM_LIT> <EOL> with tempfile . NamedTemporaryFile ( ) as f_save , tempfile . NamedTemporaryFile ( ) as f_data : <EOL> with open ( f_data . name , '<STR_LIT>' ) as data : <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> print ( "<STR_LIT>" , file = data ) <EOL> main ( "<STR_LIT:train>" , f_save . name , <NUM_LIT:1> , [ f_data . name ] ) <EOL> real_stdin = sys . stdin <EOL> sys . stdin = StringIO ( '<STR_LIT>' ) <EOL> main ( "<STR_LIT>" , f_save . name , <NUM_LIT:10> ) <EOL> sys . stdin = real_stdin <EOL> config . recursion_limit = old_limit </s>
