Skip to content

Commit 67fc52e

Browse files
committed
✅ Updated tests for shells
1 parent 1b965fd commit 67fc52e

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

tests/jobs/test_shells.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,31 @@ def test_subclass_enforcement(self):
1616

1717
def test_post_init(self):
1818
class CustomShell(BaseShell):
19-
name: str = 'bash'
20-
executable: str = '/bin/bash'
21-
is_posix: bool = True
22-
shebang: str = '#!/bin/bash'
23-
comment_char: str = '#'
24-
new_line_char: str = '\n'
25-
batch_extension: str = 'sh' # missing dot
26-
batch_command: str = '{executable} {batch_file} {batch_arguments}'
19+
name = 'bash'
20+
executable = '/bin/bash'
21+
is_posix = True
22+
shebang = '#!/bin/bash'
23+
comment_char = '#'
24+
new_line_char = '\n'
25+
batch_extension = 'sh' # missing dot
26+
batch_command = '{executable} {batch_file} {batch_arguments}'
27+
dependency_command = 'which {dependency}'
28+
execute_command = '{executable} -c {command}'
2729

2830
shell = CustomShell()
2931
assert shell.batch_extension == '.sh'
3032

3133
class WrongShell1(BaseShell):
32-
name: str = 'bash'
33-
executable: str = '/bin/bash'
34-
is_posix: bool = True
35-
shebang: str = '#!/bin/bash'
36-
comment_char: str = '#'
37-
new_line_char: str = '\n'
38-
batch_extension: str = '.sh'
39-
batch_command: str = '{executable} {batch_file}' # missing {batch_arguments}
34+
name = 'bash'
35+
executable = '/bin/bash'
36+
is_posix = True
37+
shebang = '#!/bin/bash'
38+
comment_char = '#'
39+
new_line_char = '\n'
40+
batch_extension = '.sh'
41+
batch_command = '{executable} {batch_file}' # missing {batch_arguments}
42+
dependency_command = 'which {dependency}'
43+
execute_command = '{executable} -c {command}'
4044

4145
with pytest.raises(ValueError, match='Missing key'):
4246
WrongShell1()
@@ -51,6 +55,8 @@ class WrongShell2(BaseShell):
5155
batch_extension: str = '.sh'
5256
batch_command: str = ('{executable} {batch_file} '
5357
'{batch_arguments} {whatever}') # extra key
58+
dependency_command = 'which {dependency}'
59+
execute_command = '{executable} -c {command}'
5460

5561
with pytest.raises(ValueError, match='Unexpected key'):
5662
WrongShell2()

0 commit comments

Comments
 (0)