bca01dc1c6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
831 B
Python
30 lines
831 B
Python
from chunks.config import ChunkerConfig
|
|
|
|
|
|
def test_default_values():
|
|
c = ChunkerConfig()
|
|
assert c.max_chars == 1200
|
|
assert c.min_chars == 80
|
|
assert c.target_chars == 800
|
|
assert c.context_depth == 3
|
|
assert "indice" in c.skip_headings
|
|
assert c.skip_pre_heading is True
|
|
assert c.merge_short is True
|
|
assert "table" in c.atomic_types
|
|
assert "code" in c.atomic_types
|
|
|
|
|
|
def test_custom_values():
|
|
c = ChunkerConfig(max_chars=2000, min_chars=100, context_depth=2)
|
|
assert c.max_chars == 2000
|
|
assert c.min_chars == 100
|
|
assert c.context_depth == 2
|
|
|
|
|
|
def test_skip_headings_case_insensitive_check():
|
|
c = ChunkerConfig()
|
|
skip_lower = {h.lower() for h in c.skip_headings}
|
|
assert "indice" in skip_lower
|
|
assert "sommario" in skip_lower
|
|
assert "bibliografia" in skip_lower
|