Skip to content

Commit 909da70

Browse files
committed
add bad_target test
1 parent 14fac59 commit 909da70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_packsmanager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def test_copy_examples(input, expected_paths, example_cases):
208208
("user_target", Path("user_target/packA/ex1/path1/script1.py")),
209209
],
210210
)
211-
def test_copy_example_location(input, expected_path, example_cases):
211+
def test_copy_examples_location(input, expected_path, example_cases):
212212
examples_dir = example_cases / "case5"
213213
os.chdir(example_cases / "cwd")
214214
pm = PacksManager(root_path=examples_dir)
@@ -268,19 +268,19 @@ def test_copy_examples_bad(bad_inputs, expected, path, example_cases):
268268
(Path("nonexistent/path/target"), FileNotFoundError), # doesn't exist
269269
(
270270
Path("docs/examples/packA/ex1/script4.py"),
271-
ValueError,
271+
NotADirectoryError,
272272
), # target is a file
273273
(
274274
Path("docs/examples/packA/ex1/script4.py/nested"),
275-
ValueError,
275+
NotADirectoryError,
276276
), # nested in file
277277
],
278278
)
279279
def test_copy_examples_bad_target(bad_inputs, expected, example_cases):
280280
examples_dir = example_cases / "case3"
281281
pm = PacksManager(root_path=examples_dir)
282-
with pytest.raises(NotADirectoryError):
282+
with pytest.raises(expected):
283283
pm.copy_examples(
284-
user_input=["packA"],
285-
target_dir=examples_dir / "docs/examples/packA/ex1/script4.py",
284+
user_input="packA",
285+
target_dir=bad_inputs,
286286
)

0 commit comments

Comments
 (0)