From db40b9e70b917dbbbfda48f6d77a2fc509366a82 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 22 Jun 2020 13:46:42 -0700 Subject: fmt (black) --- tests/test_database.py | 10 ++++------ tests/test_directories.py | 9 ++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/test_database.py b/tests/test_database.py index 3d41e79..dc75d23 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1,4 +1,3 @@ - from chocula.database import IssnDatabase @@ -6,10 +5,9 @@ def test_issn_database(): issn_db = IssnDatabase(issn_issnl_file_path="tests/files/ISSN-to-ISSN-L.txt") - assert issn_db.issn2issnl('1234-5678') is None - assert issn_db.issn2issnl('0000-0000') is None + assert issn_db.issn2issnl("1234-5678") is None + assert issn_db.issn2issnl("0000-0000") is None # "The Lancet" - assert issn_db.issn2issnl('0140-6736') == '0140-6736' - assert issn_db.issn2issnl('1474-547X') == '0140-6736' - + assert issn_db.issn2issnl("0140-6736") == "0140-6736" + assert issn_db.issn2issnl("1474-547X") == "0140-6736" diff --git a/tests/test_directories.py b/tests/test_directories.py index 90856bc..b366192 100644 --- a/tests/test_directories.py +++ b/tests/test_directories.py @@ -1,26 +1,29 @@ - import pytest from chocula import * + @pytest.fixture def config(): config = ChoculaConfig.from_file(sources_dir="tests/files/") return config + @pytest.fixture def issn_db(): return IssnDatabase(issn_issnl_file_path="tests/files/ISSN-to-ISSN-L.txt") + @pytest.fixture def database(issn_db): db = ChoculaDatabase(db_file=":memory:", issn_db=issn_db) db.init_db() return db + def test_all(config, database): for cls in ALL_CHOCULA_DIR_CLASSES: loader = cls(config) counts = loader.index_file(database) - assert counts['total'] >= 20 - assert counts['inserted'] > 5 + assert counts["total"] >= 20 + assert counts["inserted"] > 5 -- cgit v1.2.3