Skip to content

Commit 2d916a0

Browse files
kannon92mr-c
authored andcommitted
feat: add a new test
1 parent 81c755d commit 2d916a0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/echo-stdout-log-dir.cwl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.0
3+
class: CommandLineTool
4+
inputs:
5+
- id: inp
6+
type: string
7+
inputBinding: {}
8+
outputs: []
9+
baseCommand: echo
10+
stdout: out.txt

tests/test_stdout_stderr_log_dir.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,17 @@ def test_log_dir_echo_output() -> None:
1717
)
1818
assert "completed success" in stderr, stderr
1919
assert json.loads(stdout)['out'].strip('\n') == 'hello'
20+
21+
def test_log_dir_echo_no_output() -> None:
22+
_, stdout, stderr = get_main_output(
23+
[
24+
"--log-dir",
25+
"logs",
26+
"tests/echo-stdout-log-dir.cwl",
27+
"--inp", "hello"
28+
]
29+
)
30+
for dir in os.listdir('logs'):
31+
for file in os.listdir(f'logs/{dir}'):
32+
assert file == 'out.txt'
33+

0 commit comments

Comments
 (0)