test_ingest_one_doc_file_accepts_valid_utf8

Tests › tests/test_build_docs_db.py

passed Passed in the packaged run.

What this test is for

Why it exists

Sanity-check the strict-decode change doesn't reject legitimate UTF-8 (including multi-byte characters).

Verifies REQ-DDB-PIPE-010

Given

  1. db_path = tmp_path / "clew.db"
  2. conn = sqlite3.connect(str(db_path))
3 more
  1. conn.execute("CREATE VIRTUAL TABLE supplementary_docs USING fts5(file_path, heading, content)")
  2. good = tmp_path / "ok.md"
  3. good.write_text("# Heading\nbody with é character\n", encoding="utf-8")
→

When

  1. result = _ingest_one_doc_file(conn, good, "ok.md")
  2. rows = conn.execute("SELECT heading, content FROM supplementary_docs").fetchall()
→

Then

  1. ✓ result equals 1
  2. ✓ rows[0][0] equals "Heading"
  3. ✓ rows[0][1] contains "é"

tests/test_build_docs_db.py:401 · its file's page

What it checks (3)

  1. assert result == 1 observes _ingest_one_doc_file via result
  2. assert rows[0][0] == "Heading" not attributed
  3. assert "é" in rows[0][1] not attributed

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_ingest_one_doc_file_accepts_valid_utf8→_ingest_one_doc_file

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_ingest_one_doc_file_accepts_valid_utf8 · 3 checks_ingest_one_doc_filememoizedREQ-DDB-INDEX-002 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-010catalogunknown
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.