Skip to content

Commit d32201a

Browse files
committed
test print info and test copy examples
1 parent c70ca27 commit d32201a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_cli.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44
import pytest
55

66
from diffpy.cmi import cli
7+
from diffpy.cmi.packsmanager import PacksManager
8+
9+
10+
def test_print_info(temp_path, capsys):
11+
pkmg = PacksManager()
12+
actual = pkmg.available_examples(temp_path)
13+
# pretty print the actual dict
14+
pkmg.print_info(actual)
15+
captured = capsys.readouterr()
16+
output = captured.out.strip()
17+
# check that output contains expected headers
18+
assert "Available packs" in output or "Installed packs" in output
19+
20+
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
725

826

927
def test_map_pack_to_examples_structure():

0 commit comments

Comments
 (0)