diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 18:13:14 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 18:13:14 -0700 |
commit | cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7 (patch) | |
tree | 5e4034027b51f3ee4d2a488bb2cbb7a75c3bd0d8 /python/tests/transform_ingest.py | |
parent | 78f08280edea4ff65ca613ad30005c45cc48dea6 (diff) | |
download | fatcat-cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7.tar.gz fatcat-cdfd6b85b386b7bbf9d5a5179ef26970b6e5a4e7.zip |
fmt (black): tests/
Diffstat (limited to 'python/tests/transform_ingest.py')
-rw-r--r-- | python/tests/transform_ingest.py | 18 |
1 files changed, 9 insertions, 9 deletions
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" |