GPTdoc / tests /test_input_file.py
YvesP's picture
initial load
65642c3
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