mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-23 00:51:30 +00:00

* docker works * more epub tests * changelog version * support epub + odt + rtf * update dockerfile * revert.. * install pandoc on ci env * pandoc docker grab bashed on arch * move arch into image * move back to base image
23 lines
717 B
Python
23 lines
717 B
Python
import os
|
|
import pathlib
|
|
|
|
from unstructured.documents.elements import Title
|
|
from unstructured.partition.odt import partition_odt
|
|
|
|
DIRECTORY = pathlib.Path(__file__).parent.resolve()
|
|
EXAMPLE_DOCS_DIRECTORY = os.path.join(DIRECTORY, "..", "..", "example-docs")
|
|
|
|
|
|
def test_partition_odt_from_filename():
|
|
filename = os.path.join(EXAMPLE_DOCS_DIRECTORY, "fake.odt")
|
|
elements = partition_odt(filename=filename)
|
|
assert elements == [Title("Lorem ipsum dolor sit amet.")]
|
|
|
|
|
|
def test_partition_odt_from_file():
|
|
filename = os.path.join(EXAMPLE_DOCS_DIRECTORY, "fake.odt")
|
|
with open(filename, "rb") as f:
|
|
elements = partition_odt(file=f)
|
|
|
|
assert elements == [Title("Lorem ipsum dolor sit amet.")]
|