add test test_list_existing_collections
build / build (push) Successful in 10s

This commit is contained in:
2026-04-23 20:49:52 +02:00
committed by ForgeCode
parent a672633526
commit 4a7804af19
+11 -1
View File
@@ -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",