import os import pytest from eorg.parser import parse def test_fetch_attribute(): with open(os.path.abspath("./tests/fixtures/test.org"), "r") as fp: doc = parse(fp) assert doc.title == ' Emacs org-mode examples' def test_fetch_non_existant_attribute(): with open(os.path.abspath("./tests/fixtures/test.org"), "r") as fp: doc = parse(fp) with pytest.raises(ValueError): doc.fake