From 4a7804af1960e87b965273e5c0bdb845532d1484 Mon Sep 17 00:00:00 2001 From: Matteo Rosati Date: Thu, 23 Apr 2026 20:49:52 +0200 Subject: [PATCH] add test test_list_existing_collections --- tests/test_cli.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index f63a534..2bf39e7 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -16,7 +16,7 @@ class CliTests(unittest.TestCase): def _fixture_path(path: str) -> str: return str(Path(path).resolve()) - def test_list_collections(self) -> None: + def test_list_empty_collections(self) -> None: with patch( "chromy.handlers.list_collections.list_collections", return_value=[], @@ -26,6 +26,16 @@ class CliTests(unittest.TestCase): self.assertEqual(result.exit_code, 0) self.assertEqual(result.stdout, "No collections found.\n") + def test_list_existing_collections(self) -> None: + with patch( + "chromy.handlers.list_collections.list_collections", + return_value=["books", "code"], + ): + result = _invoke(["list-collections"]) + + self.assertEqual(result.exit_code, 0) + self.assertEqual(result.stdout, "books\ncode\n") + def test_create_collection(self) -> None: with patch( "chromy.handlers.create_collection.create_collection",