@@ -33,6 +33,17 @@ def test_singularity_iwdr():
33
33
else :
34
34
assert result_code != 0
35
35
36
+ def test_singularity_pullfolder_in_env ():
37
+ os .environ ["SINGULARITY_PULLFOLDER" ] = str (os .getcwd ())
38
+ os .environ ["SINGULARITY_CACHEDIR" ] = str (os .getcwd ())
39
+ result_code = main (
40
+ ['--singularity' , '--default-container' , 'debian' ,
41
+ get_data ("tests/wf/iwdr-entry.cwl" ), "--message" , "hello" ])
42
+ for env in ("SINGULARITY_PULLFOLDER" , "SINGULARITY_CACHEDIR" ):
43
+ if env in os .environ :
44
+ assert result_code == 0
45
+ else :
46
+ assert result_code != 0
36
47
@needs_singularity
37
48
def test_singularity_incorrect_image_pull ():
38
49
result_code , _ , stderr = get_main_output (
@@ -58,7 +69,11 @@ def test_singularity_pullfolder(tmp_path):
58
69
pull_folder = tmp_path / "pull_folder"
59
70
pull_folder .mkdir ()
60
71
os .environ ["SINGULARITY_PULLFOLDER" ] = str (pull_folder )
61
- result_code , stdout , stderr = get_main_output (
62
- ['--singularity' , get_data ("tests/sing_pullfolder_test.cwl" ), "--message" , "hello" ])
63
- file_in_dir = os .listdir (str (pull_folder ))
64
- assert 'debian.img' in file_in_dir , stderr
72
+ if "SINGULARITY_PULLFOLDER" in os .environ :
73
+ result_code , stdout , stderr = get_main_output (
74
+ ['--singularity' , get_data ("tests/sing_pullfolder_test.cwl" ), "--message" , "hello" ])
75
+ file_in_dir = os .listdir (str (pull_folder ))
76
+ assert 'debian.img' in file_in_dir , stderr
77
+ else :
78
+ asset result_code != 0
79
+
0 commit comments