From 00e99192e7f746d7739adfe031b72bd7b0fee1a6 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 23 Oct 2020 00:39:02 -0700 Subject: fixes to issue_db tests --- fatcat_scholar/issue_db.py | 4 +--- tests/test_issue_db.py | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fatcat_scholar/issue_db.py b/fatcat_scholar/issue_db.py index 466b95d..9839a60 100644 --- a/fatcat_scholar/issue_db.py +++ b/fatcat_scholar/issue_db.py @@ -425,9 +425,7 @@ def main() -> None: idb = IssueDB(args.db_file) api_conf = fatcat_openapi_client.Configuration() api_conf.host = settings.FATCAT_API_HOST - api = fatcat_openapi_client.DefaultApi( - fatcat_openapi_client.ApiClient(api_conf) - ) + api = fatcat_openapi_client.DefaultApi(fatcat_openapi_client.ApiClient(api_conf)) es_client = elasticsearch.Elasticsearch(settings.FATCAT_ELASTICSEARCH_BACKEND) if args.func == "load_pubs": diff --git a/tests/test_issue_db.py b/tests/test_issue_db.py index b29eea0..965b925 100644 --- a/tests/test_issue_db.py +++ b/tests/test_issue_db.py @@ -1,4 +1,3 @@ - import elasticsearch import fatcat_openapi_client @@ -10,17 +9,15 @@ def test_issue_db_basics() -> None: api_conf = fatcat_openapi_client.Configuration() api_conf.host = settings.FATCAT_API_HOST - api = fatcat_openapi_client.DefaultApi( - fatcat_openapi_client.ApiClient(api_conf) - ) + api = fatcat_openapi_client.DefaultApi(fatcat_openapi_client.ApiClient(api_conf)) es_client = elasticsearch.Elasticsearch(settings.FATCAT_ELASTICSEARCH_BACKEND) issue_db = IssueDB(settings.SCHOLAR_ISSUEDB_PATH) issue_db.init_db() - with open('tests/files/sim_collections.json', 'r') as f: + with open("tests/files/sim_collections.json", "r") as f: issue_db.load_pubs(f.readlines(), api) - with open('tests/files/sim_items.json', 'r') as f: + with open("tests/files/sim_items.json", "r") as f: issue_db.load_issues(f.readlines(), es_client) -- cgit v1.2.3