77
88from diffpy .utils .tools import get_package_info , get_user_info
99
10-
11- def _setup_dirs ( user_filesystem ):
12- home_dir , cwd_dir = user_filesystem . home_dir , user_filesystem . cwd_dir
13- os . chdir ( cwd_dir )
14- return home_dir
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+ #
1515
1616
1717def _run_tests (inputs , expected ):
@@ -138,8 +138,8 @@ def test_get_user_info_with_home_conf_file(runtime_inputs, expected, user_filesy
138138 ],
139139)
140140def test_get_user_info_with_local_conf_file (runtime_inputs , expected , user_filesystem , mocker ):
141- # user_filesystem[0] is tmp_dir/home_dir with the global config file in it, user_filesystem[1] i
142- # s tmp_dir/cwd_dir
141+ # user_filesystem[0] is tmp_dir/home_dir with the global config file in it, user_filesystem[1]
142+ # is tmp_dir/cwd_dir
143143 mocker .patch .object (Path , "home" , return_value = user_filesystem [0 ])
144144 os .chdir (user_filesystem [1 ])
145145 local_config_data = {"owner_name" : "cwd_ownername" , "owner_email" : "cwd@email.com" }
@@ -149,27 +149,27 @@ def test_get_user_info_with_local_conf_file(runtime_inputs, expected, user_files
149149 assert actual == expected
150150
151151
152- @pytest .mark .parametrize ("inputsa, inputsb, expected" , params_user_info_with_no_home_conf_file )
153- def test_get_user_info_with_no_home_conf_file (monkeypatch , inputsa , inputsb , expected , user_filesystem ):
154- _setup_dirs (monkeypatch , user_filesystem )
155- os .remove (Path ().home () / "diffpyconfig.json" )
156- inp_iter = iter (inputsb )
157- monkeypatch .setattr ("builtins.input" , lambda _ : next (inp_iter ))
158- _run_tests (inputsa , expected )
159- confile = Path ().home () / "diffpyconfig.json"
160- assert confile .is_file ()
161-
162-
163- @pytest .mark .parametrize ("inputsa, inputsb, expected" , params_user_info_no_conf_file_no_inputs )
164- def test_get_user_info_no_conf_file_no_inputs (monkeypatch , inputsa , inputsb , expected , user_filesystem ):
165- _setup_dirs (monkeypatch , user_filesystem )
166- os .remove (Path ().home () / "diffpyconfig.json" )
167- inp_iter = iter (inputsb )
168- monkeypatch .setattr ("builtins.input" , lambda _ : next (inp_iter ))
169- _run_tests (inputsa , expected )
170- confile = Path ().home () / "diffpyconfig.json"
171- assert confile .exists () is False
172-
152+ # @pytest.mark.parametrize("inputsa, inputsb, expected", params_user_info_with_no_home_conf_file)
153+ # def test_get_user_info_with_no_home_conf_file(monkeypatch, inputsa, inputsb, expected, user_filesystem):
154+ # _setup_dirs(monkeypatch, user_filesystem)
155+ # os.remove(Path().home() / "diffpyconfig.json")
156+ # inp_iter = iter(inputsb)
157+ # monkeypatch.setattr("builtins.input", lambda _: next(inp_iter))
158+ # _run_tests(inputsa, expected)
159+ # confile = Path().home() / "diffpyconfig.json"
160+ # assert confile.is_file()
161+ #
162+ #
163+ # @pytest.mark.parametrize("inputsa, inputsb, expected", params_user_info_no_conf_file_no_inputs)
164+ # def test_get_user_info_no_conf_file_no_inputs(monkeypatch, inputsa, inputsb, expected, user_filesystem):
165+ # _setup_dirs(monkeypatch, user_filesystem)
166+ # os.remove(Path().home() / "diffpyconfig.json")
167+ # inp_iter = iter(inputsb)
168+ # monkeypatch.setattr("builtins.input", lambda _: next(inp_iter))
169+ # _run_tests(inputsa, expected)
170+ # confile = Path().home() / "diffpyconfig.json"
171+ # assert confile.exists() is False
172+ #
173173
174174params_package_info = [
175175 (["diffpy.utils" , None ], {"package_info" : {"diffpy.utils" : "3.3.0" }}),
0 commit comments