diff --git a/news/print-info.rst b/news/print-info.rst new file mode 100644 index 0000000..f773ba1 --- /dev/null +++ b/news/print-info.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Changed the command for printing packs and examples. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/cmi/cli.py b/src/diffpy/cmi/cli.py index dbd663c..3799a1c 100644 --- a/src/diffpy/cmi/cli.py +++ b/src/diffpy/cmi/cli.py @@ -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: diff --git a/tests/test_cli.py b/tests/test_cli.py index 9eb9712..adf1479 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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():