From 552dd32f8b516577e6dfd3040a26b242c56c0eed Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sun, 22 Dec 2024 09:25:15 -0500 Subject: [PATCH] delete unneeded _get_value() function and unneeded test parms --- src/diffpy/utils/tools.py | 4 --- tests/test_tools.py | 65 --------------------------------------- 2 files changed, 69 deletions(-) diff --git a/src/diffpy/utils/tools.py b/src/diffpy/utils/tools.py index 59c5d31d..27e49ff8 100644 --- a/src/diffpy/utils/tools.py +++ b/src/diffpy/utils/tools.py @@ -122,10 +122,6 @@ def get_user_info(owner_name=None, owner_email=None, owner_orcid=None): return user_info -def _get_value(mystring): - return mystring.strip() - - def check_and_build_global_config(skip_config_creation=False): config_path = Path().home() / "diffpyconfig.json" if skip_config_creation: diff --git a/tests/test_tools.py b/tests/test_tools.py index 88e81566..d364feb9 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -7,71 +7,6 @@ from diffpy.utils.tools import check_and_build_global_config, get_package_info, get_user_info -# def _setup_dirs(monkeypatch, user_filesystem): -# home_dir, cwd_dir = user_filesystem.home_dir, user_filesystem.cwd_dir -# os.chdir(cwd_dir) -# return home_dir -# - - -def _run_tests(inputs, expected): - args = {"username": inputs[0], "email": inputs[1]} - expected_username, expected_email = expected - config = get_user_info(args) - assert config.get("username") == expected_username - assert config.get("email") == expected_email - - -params_user_info_with_local_conf_file = [ - (["", ""], ["cwd_username", "cwd@email.com"]), - (["cli_username", ""], ["cli_username", "cwd@email.com"]), - (["", "cli@email.com"], ["cwd_username", "cli@email.com"]), - ([None, None], ["cwd_username", "cwd@email.com"]), - (["cli_username", None], ["cli_username", "cwd@email.com"]), - ([None, "cli@email.com"], ["cwd_username", "cli@email.com"]), - (["cli_username", "cli@email.com"], ["cli_username", "cli@email.com"]), -] -params_user_info_with_no_home_conf_file = [ - ( - [None, None], - ["input_username", "input@email.com"], - ["input_username", "input@email.com"], - ), - ( - ["cli_username", None], - ["", "input@email.com"], - ["cli_username", "input@email.com"], - ), - ( - [None, "cli@email.com"], - ["input_username", ""], - ["input_username", "cli@email.com"], - ), - ( - ["", ""], - ["input_username", "input@email.com"], - ["input_username", "input@email.com"], - ), - ( - ["cli_username", ""], - ["", "input@email.com"], - ["cli_username", "input@email.com"], - ), - ( - ["", "cli@email.com"], - ["input_username", ""], - ["input_username", "cli@email.com"], - ), - ( - ["cli_username", "cli@email.com"], - ["input_username", "input@email.com"], - ["cli_username", "cli@email.com"], - ), -] -params_user_info_no_conf_file_no_inputs = [ - ([None, None], ["", ""], ["", ""]), -] - @pytest.mark.parametrize( "runtime_inputs, expected",