mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-22 16:37:33 +00:00
18 lines
588 B
Python
18 lines
588 B
Python
![]() |
from unstructured.documents.elements import Title
|
||
|
from unstructured.partition.rst import partition_rst
|
||
|
|
||
|
|
||
|
def test_partition_rst_from_filename(filename="example-docs/README.rst"):
|
||
|
elements = partition_rst(filename=filename)
|
||
|
|
||
|
assert elements[0] == Title("Example Docs")
|
||
|
assert elements[0].metadata.filetype == "text/x-rst"
|
||
|
|
||
|
|
||
|
def test_partition_rst_from_file(filename="example-docs/README.rst"):
|
||
|
with open(filename, "rb") as f:
|
||
|
elements = partition_rst(file=f)
|
||
|
|
||
|
assert elements[0] == Title("Example Docs")
|
||
|
assert elements[0].metadata.filetype == "text/x-rst"
|