From 5af52ae8262a82201aaf13e8eca45ee48479f118 Mon Sep 17 00:00:00 2001 From: tkwiatkowski Date: Mon, 1 Jul 2024 20:09:41 +0200 Subject: [PATCH] Fix tests --- sio/compilers/test/test_compilers.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sio/compilers/test/test_compilers.py b/sio/compilers/test/test_compilers.py index 4794365..d3027c0 100644 --- a/sio/compilers/test/test_compilers.py +++ b/sio/compilers/test/test_compilers.py @@ -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()) @@ -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( @@ -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())