From 289a307b26593916dd5238e8a9107ce848c5608a Mon Sep 17 00:00:00 2001 From: sriniv27 Date: Thu, 18 Feb 2021 08:53:09 -0500 Subject: [PATCH] delete unused and redundant code --- features/steps/core.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/features/steps/core.py b/features/steps/core.py index ed1965e3..cf75d099 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -621,7 +621,6 @@ def journal_exists(context, journal_name="default"): @then('the config should have "{key}" set to') @then('the config should have "{key}" set to "{value}"') @then('the config for journal "{journal}" should have "{key}" set to "{value}"') -@then('the config should have "{key}" set to "{value}"') def config_var(context, key, value="", journal=None): key_as_vec = key.split(".") @@ -649,35 +648,6 @@ def config_var(context, key, value="", journal=None): -@then("the runtime config should have {key_as_dots} set to {override_value}") -def config_override(context, key_as_dots: str, override_value: str): - key_as_vec = key_as_dots.split(".") - if "password" in context: - password = context.password - else: - password = "" - # fmt: off - try: - with \ - mock.patch.object(jrnl.override,"_recursively_apply",wraps=jrnl.override._recursively_apply) as spy_recurse, \ - mock.patch('jrnl.install.load_or_install_jrnl', return_value=context.jrnl_config), \ - mock.patch('getpass.getpass',side_effect=_mock_getpass(password)) \ - : - parsed_args = parse_args(context.args) - run(parsed_args) - runtime_cfg = spy_recurse.call_args_list[0][0][0] - - # extract the value of the desired key from the configuration after overrides have been applied - for k in key_as_vec: - runtime_cfg = runtime_cfg['%s'%k] - - assert runtime_cfg == override_value - except SystemExit as e : - context.exit_status = e.code - # fmt: on - - - @then('the config for journal "{journal}" should not have "{key}" set') def config_no_var(context, key, value="", journal=None): configuration = load_config(context.config_path)