File size: 801 Bytes
65642c3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from src.model.document import InputDoc
short_example = "short example"
title_example = "!!this is about Aldo Moro"
def test_short_example():
text = short_example
assert InputDoc(fulltext=text).container.normals[0].text == text
def test_title_example():
text = title_example
doc = InputDoc(fulltext=text)
assert doc.title == text.split('!!')[1]
assert doc.container.title == title_example.split('!!')[1]
assert not doc.container.children
def test_long_example():
text = open("../data/long_example.txt", "r").read()
doc = InputDoc(fulltext=text)
tasks = doc.tasks
assert doc.title == "terrorism in Italy in the years 70 and 80"
assert doc.container.title == "terrorism in Italy in the years 70 and 80"
assert len(doc.container.children) == 2
|