Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/print-info.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Changed the command for printing packs and examples.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
11 changes: 11 additions & 0 deletions src/diffpy/cmi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
from diffpy.cmi.profilesmanager import ProfilesManager


def print_info(pack_ex_dict: dict[str, List[Tuple[str, Path]]]) -> None:
"""Print information about available examples and packs.

Parameters
----------
pack_ex_dict : dict[str, List[Tuple[str, Path]]]
Dictionary mapping pack name -> list of (example name, example path).
"""
return


def copy_examples(
examples_dict: Dict[str, List[Tuple[str, Path]]], target_dir: Path = None
) -> None:
Expand Down
22 changes: 22 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
import pytest

from diffpy.cmi import cli
from diffpy.cmi.packsmanager import PacksManager


@pytest.mark.parametrize(
"input,expected",
[
("case1", "captured output for case1"),
("case2", "captured output for case2"),
("case3", "captured output for case3"),
("case4", "captured output for case4"),
("case5", "captured output for case5"),
],
)
def test_print_info(input, expected, example_cases, capsys):
case_dir = example_cases / input
pm = PacksManager(case_dir)
examples_dict = pm.available_examples()
cli.print_info(examples_dict)
captured = capsys.readouterr()
output = captured.out
assert output == expected
assert False


def test_map_pack_to_examples_structure():
Expand Down
Loading