Skip to content

Commit

Permalink
TLDR-462 -- test fix can_be_multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
raxtemur committed Nov 9, 2023
1 parent 734dab8 commit e94ce16
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/unit_tests/test_misc_on_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ def test_scan_paragraph_classifier_extractor(self) -> None:
LineWithLocation(line="Example line", metadata=metadata, annotations=[], location=location),
LineWithLocation(line="Example line 2", metadata=metadata2, annotations=[], location=location2)
]
data = classify_lines_with_location.feature_extractor.transform([lines])
lines = classify_lines_with_location.extract(lines)

if any((data[col].isna().all() for col in data.columns)):
labels = ["not_paragraph"] * len(lines)
else:
labels = classify_lines_with_location.classifier.predict(data)

self.assertEqual(labels[0], "paragraph")
self.assertEqual(labels[1], "paragraph")
self.assertEqual(lines[0].metadata.tag_hierarchy_level.can_be_multiline, False)
self.assertEqual(lines[1].metadata.tag_hierarchy_level.can_be_multiline, False)

0 comments on commit e94ce16

Please sign in to comment.