refactor(tests): remove redundant filename field
file: serve sia come path da leggere che come nome passato a detect_content_type. Non c'è motivo di averli separati. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
tests/fixtures/preprocessors/cases.yaml
vendored
5
tests/fixtures/preprocessors/cases.yaml
vendored
@@ -4,7 +4,6 @@
|
||||
# process: <content_type> → chiama preprocess(content_type, content)
|
||||
#
|
||||
# Sorgente: file: <nome in data/> oppure generate: binary_noise
|
||||
# filename: override del nome file passato a detect (default: valore di file:)
|
||||
#
|
||||
# Assertions piatte (solo per process):
|
||||
# no_html: true clean_text senza tag HTML
|
||||
@@ -17,12 +16,10 @@
|
||||
|
||||
- id: "1.1"
|
||||
file: email_action.html
|
||||
filename: email_export.html
|
||||
detect: email_html
|
||||
|
||||
- id: "1.2"
|
||||
file: generic_page.html
|
||||
filename: index.html
|
||||
detect: generic_html
|
||||
|
||||
- id: "1.3"
|
||||
@@ -30,8 +27,8 @@
|
||||
detect: plain_text
|
||||
|
||||
- id: "1.4"
|
||||
file: archive.xyz
|
||||
generate: binary_noise
|
||||
filename: archive.xyz
|
||||
detect: unknown
|
||||
|
||||
- id: "1.5"
|
||||
|
||||
@@ -68,7 +68,7 @@ def test_detect(preprocess_case, pytestconfig) -> None:
|
||||
case = preprocess_case
|
||||
data_dir = _fixtures_dir(pytestconfig) / "data"
|
||||
raw = _content(case, data_dir)
|
||||
filename = case.get("filename", case.get("file", ""))
|
||||
filename = case.get("file", "")
|
||||
ct = detect_content_type(filename, raw)
|
||||
expected = case["detect"]
|
||||
_lf_score(f"preprocess.detect.{case['id']}", 1.0 if ct == expected else 0.0)
|
||||
|
||||
Reference in New Issue
Block a user