Skip to content

Commit 6a7d9c8

Browse files
committed
add singularity tests
1 parent 2412d4f commit 6a7d9c8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/utils/test_jobcreator.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,28 @@ def test_project_job(subproc, testdata):
9595
)
9696
jc.project_job()
9797

98+
def test_singularity_exec_binds_finishdir(testdata):
99+
"""finishdir is automatically added to the --bind list of every singularity exec call."""
100+
jc = Job_Creator(
101+
run_settings={'input': '/tmp/', 'finishdir': '/tmp/test_runfolder'},
102+
config=preset_config,
103+
log=logger,
104+
sampleinfo=testdata,
105+
)
106+
cmd = jc._singularity_exec('blast', 'blastn -help')
107+
assert '/tmp/test_runfolder' in cmd
108+
109+
110+
def test_singularity_exec_does_not_duplicate_finishdir(testdata):
111+
"""finishdir is not listed twice when it already appears in config bind_paths."""
112+
config = dict(preset_config)
113+
config['singularity'] = dict(preset_config['singularity'])
114+
config['singularity']['bind_paths'] = ['/tmp/test_runfolder', '/data']
115+
jc = Job_Creator(
116+
run_settings={'input': '/tmp/', 'finishdir': '/tmp/test_runfolder'},
117+
config=config,
118+
log=logger,
119+
sampleinfo=testdata,
120+
)
121+
cmd = jc._singularity_exec('blast', 'blastn -help')
122+
assert cmd.count('/tmp/test_runfolder') == 1

0 commit comments

Comments
 (0)