<s> import os <EOL> from metakernel . tests . utils import get_kernel <EOL> def test_file_magic ( ) : <EOL> kernel = get_kernel ( ) <EOL> kernel . do_execute ( """<STR_LIT>""" , False ) <EOL> assert os . path . exists ( "<STR_LIT>" ) <EOL> with open ( "<STR_LIT>" ) as fp : <EOL> lines = fp . readlines ( ) <EOL> assert len ( lines ) == <NUM_LIT:3> <EOL> assert lines [ <NUM_LIT:0> ] == "<STR_LIT>" <EOL> assert lines [ <NUM_LIT:1> ] == "<STR_LIT>" <EOL> assert lines [ <NUM_LIT:2> ] == "<STR_LIT>" <EOL> kernel . do_execute ( """<STR_LIT>""" , False ) <EOL> assert os . path . exists ( "<STR_LIT>" ) <EOL> with open ( "<STR_LIT>" ) as fp : <EOL> lines = fp . readlines ( ) <EOL> assert len ( lines ) == <NUM_LIT:6> <EOL> assert lines [ <NUM_LIT:3> ] == "<STR_LIT>" <EOL> assert lines [ <NUM_LIT:4> ] == "<STR_LIT>" <EOL> assert lines [ <NUM_LIT:5> ] == "<STR_LIT>" <EOL> kernel . do_execute ( """<STR_LIT>""" ) <EOL> with open ( "<STR_LIT>" ) as fp : <EOL> lines = fp . readlines ( ) <EOL> assert len ( lines ) == <NUM_LIT:3> <EOL> assert lines [ <NUM_LIT:0> ] == "<STR_LIT>" <EOL> assert lines [ <NUM_LIT:1> ] == "<STR_LIT>" <EOL> assert lines [ <NUM_LIT:2> ] == "<STR_LIT>" <EOL> def teardown ( ) : <EOL> import shutil <EOL> shutil . rmtree ( "<STR_LIT>" , ignore_errors = True ) </s>
