|
7 | 7 |
|
8 | 8 | from diffpy.utils.tools import check_and_build_global_config, get_package_info, get_user_info |
9 | 9 |
|
10 | | -# def _setup_dirs(monkeypatch, user_filesystem): |
11 | | -# home_dir, cwd_dir = user_filesystem.home_dir, user_filesystem.cwd_dir |
12 | | -# os.chdir(cwd_dir) |
13 | | -# return home_dir |
14 | | -# |
15 | | - |
16 | | - |
17 | | -def _run_tests(inputs, expected): |
18 | | - args = {"username": inputs[0], "email": inputs[1]} |
19 | | - expected_username, expected_email = expected |
20 | | - config = get_user_info(args) |
21 | | - assert config.get("username") == expected_username |
22 | | - assert config.get("email") == expected_email |
23 | | - |
24 | | - |
25 | | -params_user_info_with_local_conf_file = [ |
26 | | - (["", ""], ["cwd_username", "cwd@email.com"]), |
27 | | - (["cli_username", ""], ["cli_username", "cwd@email.com"]), |
28 | | - (["", "cli@email.com"], ["cwd_username", "cli@email.com"]), |
29 | | - ([None, None], ["cwd_username", "cwd@email.com"]), |
30 | | - (["cli_username", None], ["cli_username", "cwd@email.com"]), |
31 | | - ([None, "cli@email.com"], ["cwd_username", "cli@email.com"]), |
32 | | - (["cli_username", "cli@email.com"], ["cli_username", "cli@email.com"]), |
33 | | -] |
34 | | -params_user_info_with_no_home_conf_file = [ |
35 | | - ( |
36 | | - [None, None], |
37 | | - ["input_username", "input@email.com"], |
38 | | - ["input_username", "input@email.com"], |
39 | | - ), |
40 | | - ( |
41 | | - ["cli_username", None], |
42 | | - ["", "input@email.com"], |
43 | | - ["cli_username", "input@email.com"], |
44 | | - ), |
45 | | - ( |
46 | | - [None, "cli@email.com"], |
47 | | - ["input_username", ""], |
48 | | - ["input_username", "cli@email.com"], |
49 | | - ), |
50 | | - ( |
51 | | - ["", ""], |
52 | | - ["input_username", "input@email.com"], |
53 | | - ["input_username", "input@email.com"], |
54 | | - ), |
55 | | - ( |
56 | | - ["cli_username", ""], |
57 | | - ["", "input@email.com"], |
58 | | - ["cli_username", "input@email.com"], |
59 | | - ), |
60 | | - ( |
61 | | - ["", "cli@email.com"], |
62 | | - ["input_username", ""], |
63 | | - ["input_username", "cli@email.com"], |
64 | | - ), |
65 | | - ( |
66 | | - ["cli_username", "cli@email.com"], |
67 | | - ["input_username", "input@email.com"], |
68 | | - ["cli_username", "cli@email.com"], |
69 | | - ), |
70 | | -] |
71 | | -params_user_info_no_conf_file_no_inputs = [ |
72 | | - ([None, None], ["", ""], ["", ""]), |
73 | | -] |
74 | | - |
75 | 10 |
|
76 | 11 | @pytest.mark.parametrize( |
77 | 12 | "runtime_inputs, expected", |
|
0 commit comments