77import pytest
88
99from pylhc_submitter .job_submitter import main as job_submit
10- from pylhc_submitter .submitter .iotools import get_server_from_uri , is_eos_uri , uri_to_path
10+ from pylhc_submitter .submitter .iotools import uri_to_path
1111from pylhc_submitter .utils .environment import on_linux , on_windows
1212
1313SUBFILE = "queuehtc.sub"
@@ -41,7 +41,6 @@ def test_output_directory(tmp_path):
4141 )
4242 setup .create_mask ()
4343 job_submit (** asdict (setup ))
44- _test_output (setup )
4544
4645
4746def test_detects_wrong_uri (tmp_path ):
@@ -62,7 +61,6 @@ def test_detects_wrong_uri(tmp_path):
6261 assert "EOS-URI" in str (e )
6362
6463
65-
6664@run_only_on_linux
6765def test_job_creation_and_localrun_with_multiline_maskstring (tmp_path ):
6866 """ Tests that the jobs are created and can be run locally from a multiline mask-string. """
@@ -84,6 +82,23 @@ def test_job_creation_and_dryrun(tmp_path, maskfile):
8482 _test_output (setup , post_run = False )
8583
8684
85+ @run_only_on_linux
86+ @pytest .mark .parametrize ("maskfile" , [True , False ])
87+ @pytest .mark .parametrize ("destination" , [True , False ])
88+ def test_more_subfile_content (tmp_path , maskfile , destination ):
89+ """ Tests that the jobs are created as dry-run from mask-file and from mask-string. """
90+ setup = InputParameters (
91+ jobflavour = "espresso" , # change from default
92+ working_directory = tmp_path ,
93+ dryrun = True ,
94+ output_destination = tmp_path / "my_new_output" / "long_path" if destination else None ,
95+ job_output_dir = "MyOutputDataHere" , # change from default
96+ )
97+ setup .create_mask (as_file = maskfile )
98+ job_submit (** asdict (setup ))
99+ _test_subfile_content (setup )
100+
101+
87102@run_only_on_linux
88103@pytest .mark .parametrize ("maskfile" , [True , False ])
89104def test_find_errorneous_percentage_signs (tmp_path , maskfile ):
@@ -243,7 +258,7 @@ def _test_subfile_content(setup: InputParameters):
243258 if setup .output_destination is None :
244259 assert filecontents ["transfer_output_files" ] == setup .job_output_dir
245260 else :
246- assert "transfer_output_files" not in filecontents
261+ assert filecontents [ "transfer_output_files" ] == '""'
247262
248263 for key in setup .htc_arguments .keys ():
249264 assert filecontents [key ] == setup .htc_arguments [key ]
0 commit comments