From d908f7cf569b64171a936439be15f82d310e9e8d Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Tue, 4 Oct 2022 08:35:08 +0100 Subject: [PATCH] =?UTF-8?q?rose=5Fstem=5Fcmd=20=E2=87=92=20rose=5Fstem=5Fo?= =?UTF-8?q?pts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/functional/test_rose_stem.py | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/functional/test_rose_stem.py b/tests/functional/test_rose_stem.py index 453554db..7be8ae13 100644 --- a/tests/functional/test_rose_stem.py +++ b/tests/functional/test_rose_stem.py @@ -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 = '' @@ -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 { @@ -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(): @@ -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(): @@ -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: @@ -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: @@ -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: @@ -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'], @@ -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') @@ -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"]}'], @@ -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') @@ -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']), @@ -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' @@ -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']), @@ -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)