Skip to content

Commit

Permalink
tests: fix folder name and check against authors
Browse files Browse the repository at this point in the history
  • Loading branch information
kiike committed Mar 5, 2024
1 parent 15b9373 commit a77992e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import yaml
import pytest

import papis.testing
import papis.yaml
import papis.document
import papis_zotero.sql
Expand All @@ -19,14 +20,14 @@ def test_simple(tmp_library: TemporaryLibrary) -> None:
assert len(folders) == 5
assert len(glob.glob(tmp_library.libdir + "/**/*.pdf")) == 4

doc = papis.document.from_folder(os.path.join(tmp_library.libdir, "IH8J2JJP"))
doc = papis.document.from_folder(os.path.join(tmp_library.libdir, "95e29aafd24e14274ab8a1bb7887e2b7-svard-magnus-and-no"))

info_name = os.path.join(os.path.dirname(__file__), "resources", "sql_out.yaml")
with open(info_name, encoding="utf-8") as fd:
data = yaml.load(fd, Loader=papis.yaml.Loader) # type: ignore[attr-defined]
expected_doc = papis.document.from_data(data)

assert expected_doc["ref"] == doc["ref"]
assert expected_doc["authors"] == doc["authors"]

# FIXME: currently fails on windows
# assert doc.get_files()

0 comments on commit a77992e

Please sign in to comment.