@@ -279,3 +279,28 @@ def test_dlazaw_ocen(create_package):
279279
280280 assert not os .path .exists (os .path .join (tmpdir , task_id , "attachments" , f"{ task_id } ocen.zip" ))
281281 assert os .path .join (tmpdir , task_id , "attachments" , f"dlazaw.zip" )
282+
283+
284+ @pytest .mark .parametrize ("create_package" , [util .get_simple_package_path ()], indirect = True )
285+ def test_e_files_removal (create_package ):
286+ """
287+ Test if .e files are removed from the prog directory in the archive.
288+ """
289+ package_path = create_package
290+ task_id = package_util .get_task_id ()
291+ prog_path = os .path .join (package_path , "prog" )
292+ e_file = os .path .join (prog_path , f"{ task_id } e.e" )
293+ with open (e_file , "w" ) as f :
294+ f .write ("This is a test e file." )
295+
296+ parser = configure_parsers ()
297+ args = parser .parse_args (["export" , "--no-statement" ])
298+ command = Command ()
299+ command .run (args )
300+
301+ with tempfile .TemporaryDirectory () as tmpdir :
302+ with tarfile .open (f'{ task_id } .tgz' , "r" ) as tar :
303+ sinol_util .extract_tar (tar , tmpdir )
304+
305+ extracted = os .path .join (tmpdir , task_id )
306+ assert not os .path .exists (os .path .join (extracted , "prog" , f"{ task_id } e.e" ))
0 commit comments