eorg/tests/test_documents.py

18 lines
426 B
Python
Executable File

import os
import pytest
from eorg.parser import parse
def test_basic():
with open(os.path.abspath("./tests/fixtures/test.org"), "r") as fp:
doc = parse(fp)
assert doc.title != ''
assert doc.author != ''
assert len(doc) == 20
def test_body():
with open(os.path.abspath("./tests/fixtures/test.org"), "r") as fp:
doc = parse(fp)
assert len([i for i in doc.body()]) > 0