MCPcopy
hub / github.com/MinishLab/semble / test_chunk_source_language

Function test_chunk_source_language

tests/test_chunker.py:34–45  ·  view source on GitHub ↗

Check that chunking defaults to line splitting with non-existent and None languages.

()

Source from the content-addressed store, hash-verified

32
33
34def test_chunk_source_language() -> None:
35 """Check that chunking defaults to line splitting with non-existent and None languages."""
36 with patch("semble.chunking.chunking.chunk_lines", wraps=chunk_lines) as chunk_line_spy:
37 assert chunk_source("hello", "foo.loki", "loki") == [
38 Chunk(content="hello", file_path="foo.loki", start_line=1, end_line=1, language="loki")
39 ]
40 chunk_line_spy.assert_called_once()
41 with patch("semble.chunking.chunking.chunk_lines", wraps=chunk_lines) as chunk_line_spy:
42 assert chunk_source("1+1=3", "foo.json", None) == [
43 Chunk(content="1+1=3", file_path="foo.json", start_line=1, end_line=1, language=None)
44 ]
45 chunk_line_spy.assert_called_once()
46
47
48def test_core_chunk_empty_input() -> None:

Callers

nothing calls this directly

Calls 2

chunk_sourceFunction · 0.90
ChunkClass · 0.85

Tested by

no test coverage detected