Files
cleveragents-core/features/acms_read_file_coverage.feature
T
HAL9000 b891b081a7 test(acms): add direct _read_file and add_command traversal coverage
Adds a focused feature file that directly exercises the diff-coverage
gaps reported by the coverage gate across 13 prior attempts:

  acms/index.py  lines 597-612  (_read_file: stat + size-check + read_text)
  context.py     lines 111-112  (add_command: traverser invocation)

Three scenarios, each targeting specific line ranges:
1. _read_file with default traverser covers lines 597-598, 611-612
2. _read_file with max_file_size=1 covers lines 602-607
3. add_command with real ChunkedFileTraverser covers lines 111-112
   (also transitively covers 597-612 via _read_file)

ISSUES CLOSED: #9982
2026-06-18 19:29:14 -04:00

21 lines
995 B
Gherkin

Feature: ChunkedFileTraverser _read_file and add_command traversal coverage
Direct coverage for diff lines that the parallel test runner may not
reach via the acms_context_add.feature scenarios:
acms/index.py lines 597-612 (_read_file stat + size-check + read_text)
context.py lines 111-112 (add_command traverser invocation)
Background:
Given a temp file exists for read file coverage
Scenario: _read_file returns AcmsIndexEntry for a normal readable file
When I directly call _read_file with default traverser
Then the direct read file result should be an AcmsIndexEntry
Scenario: _read_file returns None when file exceeds max_file_size
When I directly call _read_file with max_file_size 1
Then the direct read file result should be None
Scenario: add_command invokes the real traverser for an existing path
When I call add_command with the real traverser and a mocked container
Then the mocked add_to_context should have been called