Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff128 committed Jul 1, 2024
1 parent 3b3d536 commit 5af52ae
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions sio/compilers/test/test_compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ def test_output_compilation_and_running(source):
)
eq_(post_run_env['result_code'], 'OK')

ft.download(post_run_env, 'out_file', tempcwd('out.txt'))
ft.download({'source_file': source}, 'source_file', tempcwd('source.txt'))
with open(tempcwd('out.txt'), 'r') as outfile:
with open(tempcwd('out'), 'r') as outfile:
with open(tempcwd('source.txt'), 'r') as sourcefile:
eq_(outfile.read(), sourcefile.read())

Expand All @@ -195,10 +194,10 @@ def test_output_archive_compilation_and_running(source):
eq_(result_env['result_code'], 'OK')
eq_(result_env['exec_info'], {'mode': 'output-only'})

ft.download(result_env, 'out_file', tempcwd('out.txt'))
ft.download({'source_file': source}, 'source_file', tempcwd('source.txt'))
with open(tempcwd('out.txt'), 'r') as outfile:
with open(tempcwd('source.txt'), 'r') as sourcefile:
ft.download(result_env, 'out_file', tempcwd('out.zip'))
ft.download({'source_file': source}, 'source_file', tempcwd('source.zip'))
with open(tempcwd('out.zip'), 'rb') as outfile:
with open(tempcwd('source.zip'), 'rb') as sourcefile:
eq_(outfile.read(), sourcefile.read())

post_run_env = run_from_executors(
Expand All @@ -214,10 +213,10 @@ def test_output_archive_compilation_and_running(source):
)
eq_(post_run_env['result_code'], 'OK')

ft.download(post_run_env, 'out_file', tempcwd('out.txt'))
ft.download({'source_file': source}, 'source_file', tempcwd('source.txt'))
with open(tempcwd('out.txt'), 'r') as outfile:
with open(tempcwd('source.txt'), 'r') as sourcefile:
# abc0.out in simple.zip is the same as simple.txt
ft.download({'source_file': '/simple.txt'}, 'source_file', tempcwd('simple.txt'))
with open(tempcwd('out'), 'r') as outfile:
with open(tempcwd('simple.txt'), 'r') as sourcefile:
eq_(outfile.read(), sourcefile.read())


Expand Down

0 comments on commit 5af52ae

Please sign in to comment.