From 498677bbe0a04af2ca527bdff83d02bb0710dac9 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 22 Oct 2020 20:17:06 -0700 Subject: improve test coverage --- tests/test_work_pipeline.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/test_work_pipeline.py (limited to 'tests/test_work_pipeline.py') diff --git a/tests/test_work_pipeline.py b/tests/test_work_pipeline.py new file mode 100644 index 0000000..439a186 --- /dev/null +++ b/tests/test_work_pipeline.py @@ -0,0 +1,26 @@ +from fatcat_scholar.issue_db import IssueDB +from fatcat_scholar.sandcrawler import ( + SandcrawlerPostgrestClient, + SandcrawlerMinioClient, +) +from fatcat_scholar.work_pipeline import * +from fatcat_scholar.config import settings + + +def test_run_transform() -> None: + + issue_db = IssueDB(settings.SCHOLAR_ISSUEDB_PATH) + issue_db.init_db() + + wp = WorkPipeline( + issue_db=issue_db, + sandcrawler_db_client=SandcrawlerPostgrestClient( + api_url=settings.SANDCRAWLER_DB_API + ), + sandcrawler_s3_client=SandcrawlerMinioClient( + host_url=settings.SANDCRAWLER_S3_API + ), + ) + + with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4_sans.json", "r") as f: + wp.run_releases(f.readlines()) -- cgit v1.2.3