Fix test assertion for content splitting logic

- Corrected test_generate_output_content_splitting_very_small_limit to expect 10 words instead of 8
- The test now properly accounts for opening tag (2 words) + raw content (8 words) in the same segment
- Reflects actual behavior where opening tag and content are grouped together when they fit within word limit
This commit is contained in:
Kirill Markin 2025-05-25 11:20:34 +03:00
parent 0ace858645
commit de1c84eca3
No known key found for this signature in database
GPG key ID: 03AB9530E15B9C1C

View file

@ -542,8 +542,12 @@ def test_generate_output_content_splitting_very_small_limit(mock_get_tree: Magic
found_raw_content_segment = True found_raw_content_segment = True
break break
else: else:
# Raw content by itself (8 words) # Segment contains opening tag + raw content (2 + 8 = 10 words)
assert segment_wc == count_words_for_test(raw_file1_content) # 8 words # Opening tag: <content full_path="file1.txt"> (2 words)
# Raw content: "This is file one. It has eight words." (8 words)
opening_tag_word_count = 2 # <content and full_path="file1.txt">
expected_word_count = opening_tag_word_count + count_words_for_test(raw_file1_content)
assert segment_wc == expected_word_count # Should be 10 words
found_raw_content_segment = True found_raw_content_segment = True
break break
assert found_raw_content_segment, "Segment with raw file1 content not found or not matching expected structure" assert found_raw_content_segment, "Segment with raw file1 content not found or not matching expected structure"