Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Dec 5, 2023
1 parent fb6dc73 commit c093df3
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions tests/functional/test_rose_stem.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,33 +496,24 @@ def with_config(


class TestWithConfig:
@pytest.mark.parametrize(
'expected',
[
"run_ok",
(
"RUN_NAMES=[\'earl_grey\', \'milk\', \'sugar\', "
"\'spoon\', \'cup\', \'milk\']"
),
"SOURCE_FOO=\"{workingcopy} fcm:foo.x_tr@head\"",
"HOST_SOURCE_FOO=\"{hostname}:{workingcopy} fcm:foo.x_tr@head\"",
"SOURCE_FOO_BASE=\"{workingcopy}\"",
"HOST_SOURCE_FOO_BASE=\"{hostname}:{workingcopy}\"",
"SOURCE_FOO_REV=\"\"",
"MILK=\"true\"",
]
)
def test_with_config(self, with_config, expected, monkeypatch):
def test_with_config(self, with_config):
"""test for successful execution with site/user configuration
"""
if expected == 'run_ok':
assert with_config['run_stem'].returncode == 0
else:
expected = expected.format(
workingcopy=with_config['workingcopy'],
assert with_config['run_stem'].returncode == 0
for line in [
"RUN_NAMES=['earl_grey', 'milk', 'sugar', 'spoon', 'cup', 'milk']",
'SOURCE_FOO="{workingcopy} fcm:foo.x_tr@head"',
'HOST_SOURCE_FOO="{hostname}:{workingcopy} fcm:foo.x_tr@head"',
'SOURCE_FOO_BASE="{workingcopy}"',
'HOST_SOURCE_FOO_BASE="{hostname}:{workingcopy}"',
'SOURCE_FOO_REV=""',
'MILK="true"',
]:
line = line.format(
**with_config,
hostname=HOST
)
assert expected in with_config['jobout_content']
assert line in with_config['jobout_content']


@pytest.fixture(scope='class')
Expand Down

0 comments on commit c093df3

Please sign in to comment.