11import os
22from pathlib import Path
3+ from shutil import copytree
34
45import pytest
56
67from diffpy .cmi import cli
78from diffpy .cmi .packsmanager import PacksManager
89
910
11+ @pytest .mark .parametrize (
12+ "input,to_cwd,expected" ,
13+ [
14+ # PARAMS:
15+ # input: list - list of example(s) and/or pack(s) to copy
16+ # to_cwd: bool - whether to copy to cwd (default) or a target dir
17+ # expected: list - path of copied example(s) and/or pack(s)
18+ # 1a) user wants to copy one example to cwd
19+ # 1b) user wants to copy one example to a target dir
20+ (),
21+ # 2a) user wants to copy multiple examples to cwd
22+ # 2b) user wants to copy multiple examples to a target dir
23+ (),
24+ # 3a) user wants to copy all examples from a pack to cwd
25+ # 3b) user wants to copy all examples from a pack to a target dir
26+ (),
27+ # 4a) user wants to copy all examples from multiple packs to cwd
28+ # 4b) user wants to copy all examples from multiple packs to target dir
29+ (),
30+ # 5a) user wants to copy a combination of packs and examples to cwd
31+ # 5b) user wants to copy a combination of packs and examples to target
32+ (),
33+ # 6a) user wants to copy all examples from all packs to cwd
34+ # 6b) user wants to copy all examples from all packs to a target dir
35+ (),
36+ ],
37+ )
38+ def test_copy_examples (input , to_cwd , expected , example_cases , target_dir ):
39+ tmp_ex_dir = example_cases / input
40+ copytree (tmp_ex_dir , target_dir )
41+ # pkmg = PacksManager()
42+ # actual = cli.copy_examples(str(target_dir))
43+ assert False
44+
45+
1046def test_print_info (temp_path , capsys ):
1147 pkmg = PacksManager ()
1248 actual = pkmg .available_examples (temp_path )
@@ -18,12 +54,7 @@ def test_print_info(temp_path, capsys):
1854 assert "Available packs" in output or "Installed packs" in output
1955
2056
21- @pytest .mark .parametrize ()
22- def test_copy_examples (dict , tmp_path ):
23- cli .copy_examples (examples = dict , target_dir = tmp_path )
24- assert False
25-
26-
57+ # NOTE: double check and remove these test after new above tests are made
2758def test_map_pack_to_examples_structure ():
2859 """Test that map_pack_to_examples returns the right shape of
2960 data."""
0 commit comments