Skip to content

Commit 8285277

Browse files
committed
finalizing all the tests, not just the good ones
1 parent 1643f8d commit 8285277

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/diffpy/labpdfproc/tests/test_tools.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
def test_set_input_lists(inputs, expected, user_filesystem):
7373
base_dir = Path(user_filesystem)
7474
os.chdir(base_dir)
75-
expected_paths = [Path(user_filesystem).resolve() / expected_path for expected_path in expected]
75+
expected_paths = [base_dir.resolve() / expected_path for expected_path in expected]
7676

7777
cli_inputs = ["2.5"] + inputs
7878
actual_args = get_args(cli_inputs)
@@ -88,20 +88,6 @@ def test_set_input_lists(inputs, expected, user_filesystem):
8888
]
8989

9090

91-
@pytest.mark.parametrize("inputs, expected", params_input_not_cwd)
92-
def test_set_input_files_not_cwd(inputs, expected, user_filesystem):
93-
expected_input_directory = []
94-
for expected_path in expected:
95-
expected_input_directory.append(Path(user_filesystem) / expected_path)
96-
actual_input = [str(Path(user_filesystem) / inputs[0])]
97-
os.chdir("input_dir")
98-
99-
cli_inputs = ["2.5"] + actual_input
100-
actual_args = get_args(cli_inputs)
101-
actual_args = set_input_lists(actual_args)
102-
assert set(actual_args.input_directory) == set(expected_input_directory)
103-
104-
10591
# This test covers non-existing single input file or directory, in this case we raise an error with message
10692
params_input_bad = [
10793
(["non_existing_file.xy"], "Please specify at least one valid input file or directory."),
@@ -112,15 +98,14 @@ def test_set_input_files_not_cwd(inputs, expected, user_filesystem):
11298

11399
@pytest.mark.parametrize("inputs, msg", params_input_bad)
114100
def test_set_input_files_bad(inputs, msg, user_filesystem):
101+
base_dir = Path(user_filesystem)
102+
os.chdir(base_dir)
115103
cli_inputs = ["2.5"] + inputs
116104
actual_args = get_args(cli_inputs)
117105
with pytest.raises(ValueError, match=msg[0]):
118106
actual_args = set_input_lists(actual_args)
119107

120108

121-
# Pass files to loadData and use it to check if file is valid or not
122-
123-
124109
params1 = [
125110
([], ["."]),
126111
(["--output-directory", "."], ["."]),

0 commit comments

Comments
 (0)