From cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 2 Nov 2021 18:13:14 -0700 Subject: fmt (black): tests/ --- python/tests/transform_ingest.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'python/tests/transform_ingest.py') diff --git a/python/tests/transform_ingest.py b/python/tests/transform_ingest.py index 6a358c8e..4949c109 100644 --- a/python/tests/transform_ingest.py +++ b/python/tests/transform_ingest.py @@ -1,4 +1,3 @@ - import json from fatcat_openapi_client import * @@ -9,14 +8,15 @@ from fatcat_tools.transforms import release_ingest_request def test_basic_ingest_release(crossref_importer): - with open('tests/files/crossref-works.single.json', 'r') as f: + with open("tests/files/crossref-works.single.json", "r") as f: # not a single line raw = json.loads(f.read()) r = crossref_importer.parse_record(raw) - r.state = 'active' + r.state = "active" req = release_ingest_request(r) assert req is not None + def test_rich_ingest_release(): r = ReleaseEntity( title="something", @@ -29,7 +29,7 @@ def test_rich_ingest_release(): ReleaseRef(target_release_id="iznnn644szdwva7khyxqzc73bi"), ], ) - r.state = 'active' + r.state = "active" r.container = ContainerEntity( name="dummy journal", extra={ @@ -52,12 +52,12 @@ def test_rich_ingest_release(): ) ir = release_ingest_request(r) assert ir is not None - assert ir['base_url'] == 'https://doi.org/10.123/456' - assert ir['ext_ids']['doi'] == '10.123/456' - assert ir['ext_ids'].get('pmcid') is None - assert ir['ingest_type'] == 'pdf' + assert ir["base_url"] == "https://doi.org/10.123/456" + assert ir["ext_ids"]["doi"] == "10.123/456" + assert ir["ext_ids"].get("pmcid") is None + assert ir["ingest_type"] == "pdf" # check ingest type ("d-lib") r.container_id = "ugbiirfvufgcjkx33r3cmemcuu" ir = release_ingest_request(r) - assert ir['ingest_type'] == 'html' + assert ir["ingest_type"] == "html" -- cgit v1.2.3