MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / test_add_skipped_file

Method test_add_skipped_file

tests/test_add_command.py:224–241  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

222 assert "does not exist" in result.output
223
224 def test_add_skipped_file(self, tmp_path):
225 kb_dir = self._setup_kb(tmp_path)
226 doc = tmp_path / "test.md"
227 doc.write_text("# Hello")
228
229 from openkb.converter import ConvertResult
230
231 mock_result = ConvertResult(skipped=True)
232
233 runner = CliRunner()
234 with (
235 patch("openkb.cli._find_kb_dir", return_value=kb_dir),
236 patch("openkb.cli.convert_document", return_value=mock_result),
237 patch("openkb.cli.asyncio.run") as mock_arun,
238 ):
239 result = runner.invoke(cli, ["add", str(doc)])
240 assert "SKIP" in result.output
241 mock_arun.assert_not_called()
242
243 def test_add_short_doc_runs_compiler(self, tmp_path):
244 kb_dir = self._setup_kb(tmp_path)

Callers

nothing calls this directly

Calls 2

_setup_kbMethod · 0.95
ConvertResultClass · 0.90

Tested by

no test coverage detected