use absolute paths

This commit is contained in:
2026-04-23 19:56:11 +02:00
committed by ForgeCode
parent fb5d0f7c0c
commit e5b63ac6fb
3 changed files with 29 additions and 3 deletions
+9 -1
View File
@@ -4,6 +4,7 @@ import io
import unittest
from collections.abc import Callable
from contextlib import redirect_stdout
from pathlib import Path
from typing import TypeVar
from unittest.mock import patch
@@ -21,6 +22,10 @@ CommandT = TypeVar("CommandT")
class HandlerTests(unittest.TestCase):
@staticmethod
def _fixture_path(path: str) -> str:
return str(Path(path).resolve())
def test_list_collections_prints_empty_message(self) -> None:
with patch(
"chromy.handlers.list_collections.list_collections", return_value=[]
@@ -94,7 +99,10 @@ class HandlerTests(unittest.TestCase):
"romeo_and_juliet.txt",
)
ingest_file.assert_called_once_with("notes", "romeo_and_juliet.txt")
ingest_file.assert_called_once_with(
"notes",
self._fixture_path("romeo_and_juliet.txt"),
)
self.assertEqual(exit_code, 0)
self.assertEqual(output, "Added 3 records to collection 'notes'.\n")