Skip to content

Commit

Permalink
rose_stem_cmd ⇒ rose_stem_opts
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Oct 4, 2022
1 parent a4c09d5 commit d908f7c
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/functional/test_rose_stem.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ def rose_stem_run_template(setup_stem_repo, pytestconfig, monkeymodule):
"""
verbosity = pytestconfig.getoption('verbose')

def _inner_fn(rose_stem_cmd, verbosity=verbosity):
def _inner_fn(rose_stem_opts, verbosity=verbosity):
monkeymodule.setattr('sys.argv', ['stem'])
monkeymodule.chdir(setup_stem_repo['workingcopy'])
parser, opts = _get_rose_stem_opts()
[setattr(opts, key, val) for key, val in rose_stem_cmd.items()]
[setattr(opts, key, val) for key, val in rose_stem_opts.items()]

run_stem = SimpleNamespace()
run_stem.stdout = ''
Expand All @@ -229,7 +229,7 @@ def _inner_fn(rose_stem_cmd, verbosity=verbosity):
run_stem.returncode = 0
run_stem.stderr = ''
except Exception as exc:
run_stem.returncode = 0
run_stem.returncode = 1
run_stem.stderr = exc

return {
Expand All @@ -246,14 +246,14 @@ def _inner_fn(rose_stem_cmd, verbosity=verbosity):

@pytest.fixture(scope='class')
def rose_stem_run_basic(rose_stem_run_template, setup_stem_repo):
rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['earl_grey', 'milk,sugar', 'spoon,cup,milk'],
'stem_sources': [
str(setup_stem_repo['workingcopy']), "fcm:foo.x_tr@head"
],
'workflow_name': setup_stem_repo['suitename']
}
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)


class TestBasic():
Expand Down Expand Up @@ -287,14 +287,14 @@ def test_basic(self, rose_stem_run_basic, expected):
def project_override(
rose_stem_run_template, setup_stem_repo
):
rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['earl_grey', 'milk,sugar', 'spoon,cup,milk'],
'stem_sources': [
f'bar={str(setup_stem_repo["workingcopy"])}', "fcm:foo.x_tr@head"
],
'workflow_name': setup_stem_repo['suitename']
}
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)


class TestProjectOverride():
Expand Down Expand Up @@ -336,13 +336,13 @@ def test_project_override(self, project_override, expected):
def suite_redirection(
rose_stem_run_template, setup_stem_repo
):
rose_stem_cmd = {
rose_stem_opts = {
'source': f'{setup_stem_repo["workingcopy"]}/rose-stem',
'stem_groups': ['lapsang'],
'stem_sources': ["fcm:foo.x_tr@head"],
'workflow_name': setup_stem_repo['suitename']
}
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)


class TestSuiteRedirection:
Expand Down Expand Up @@ -373,12 +373,12 @@ def test_suite_redirection(self, suite_redirection, expected):
def subdirectory(
rose_stem_run_template, setup_stem_repo
):
rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['assam'],
'stem_sources': [f'{setup_stem_repo["workingcopy"]}/rose-stem'],
'workflow_name': setup_stem_repo['suitename']
}
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)


class TestSubdirectory:
Expand Down Expand Up @@ -412,12 +412,12 @@ def test_subdirectory(self, subdirectory, expected):
def relative_path(
rose_stem_run_template, setup_stem_repo
):
rose_stem_cmd = {
rose_stem_opts = {
'source': './rose-stem',
'stem_groups': ['ceylon'],
'workflow_name': setup_stem_repo['suitename']
}
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)


class TestRelativePath:
Expand Down Expand Up @@ -454,7 +454,7 @@ def with_config(
):
"""test for successful execution with site/user configuration
"""
rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['earl_grey', 'milk,sugar', 'spoon,cup,milk'],
'stem_sources': [
f'{setup_stem_repo["workingcopy"]}', 'fcm:foo.x_tr@head'],
Expand All @@ -467,7 +467,7 @@ def with_config(
monkeymodule.setenv(
'ROSE_CONF_PATH', str(setup_stem_repo['basetemp'])
)
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)
monkeymodule.delenv('ROSE_CONF_PATH')


Expand Down Expand Up @@ -507,7 +507,7 @@ def with_config2(
):
"""test for successful execution with site/user configuration
"""
rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['assam'],
'stem_sources': [
f'{setup_stem_repo["workingcopy"]}'],
Expand All @@ -520,7 +520,7 @@ def with_config2(
monkeymodule.setenv(
'ROSE_CONF_PATH', str(setup_stem_repo['basetemp'])
)
yield rose_stem_run_template(rose_stem_cmd)
yield rose_stem_run_template(rose_stem_opts)
monkeymodule.delenv('ROSE_CONF_PATH')


Expand Down Expand Up @@ -557,7 +557,7 @@ def test_incompatible_versions(setup_stem_repo, monkeymodule):
)
shutil.copy2(src, dest)

rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['earl_grey', 'milk,sugar', 'spoon,cup,milk'],
'stem_sources': [
str(setup_stem_repo['workingcopy']),
Expand All @@ -569,7 +569,7 @@ def test_incompatible_versions(setup_stem_repo, monkeymodule):
monkeymodule.setattr('sys.argv', ['stem'])
monkeymodule.chdir(setup_stem_repo['workingcopy'])
parser, opts = _get_rose_stem_opts()
[setattr(opts, key, val) for key, val in rose_stem_cmd.items()]
[setattr(opts, key, val) for key, val in rose_stem_opts.items()]

with pytest.raises(
RoseStemVersionException, match='1 but suite is at version 0'
Expand All @@ -582,7 +582,7 @@ def test_project_not_in_keywords(setup_stem_repo, monkeymodule, capsys):
"""
# Copy suite into working copy.
monkeymodule.delenv('FCM_CONF_PATH')
rose_stem_cmd = {
rose_stem_opts = {
'stem_groups': ['earl_grey', 'milk,sugar', 'spoon,cup,milk'],
'stem_sources': [
str(setup_stem_repo['workingcopy']),
Expand All @@ -594,7 +594,7 @@ def test_project_not_in_keywords(setup_stem_repo, monkeymodule, capsys):
monkeymodule.setattr('sys.argv', ['stem'])
monkeymodule.chdir(setup_stem_repo['workingcopy'])
parser, opts = _get_rose_stem_opts()
[setattr(opts, key, val) for key, val in rose_stem_cmd.items()]
[setattr(opts, key, val) for key, val in rose_stem_opts.items()]

rose_stem(parser, opts)

Expand Down

0 comments on commit d908f7c

Please sign in to comment.