diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-14 13:42:57 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-14 13:43:07 -0700 |
commit | c01a4ba190cc18a8186545ebb55c35864676b538 (patch) | |
tree | 6ec59ce457bcaa50932f04c44fd781a53ae33c52 | |
parent | 3ee54189b665d37933b6108fb85b28bb823dac4a (diff) | |
download | fatcat-c01a4ba190cc18a8186545ebb55c35864676b538.tar.gz fatcat-c01a4ba190cc18a8186545ebb55c35864676b538.zip |
python impl
-rw-r--r-- | python/fatcat_tools/importers/arabesque.py | 4 | ||||
-rwxr-xr-x | python/fatcat_tools/importers/cdl_dash_dat.py | 8 | ||||
-rw-r--r-- | python/fatcat_tools/importers/crossref.py | 4 | ||||
-rw-r--r-- | python/fatcat_tools/importers/grobid_metadata.py | 8 | ||||
-rw-r--r-- | python/fatcat_tools/importers/matched.py | 4 | ||||
-rwxr-xr-x | python/fatcat_tools/importers/wayback_static.py | 4 | ||||
-rw-r--r-- | python/fatcat_web/forms.py | 6 | ||||
-rw-r--r-- | python/tests/api_entity_state.py | 6 | ||||
-rw-r--r-- | python/tests/api_files.py | 2 | ||||
-rw-r--r-- | python/tests/api_filesets.py | 16 | ||||
-rw-r--r-- | python/tests/api_releases.py | 16 | ||||
-rw-r--r-- | python/tests/api_webcaptures.py | 20 | ||||
-rw-r--r-- | python/tests/citation_efficiency.py | 12 | ||||
-rw-r--r-- | python/tests/fixtures.py | 2 | ||||
-rw-r--r-- | python/tests/subentity_state.py | 12 | ||||
-rw-r--r-- | python/tests/transform_tests.py | 8 |
16 files changed, 66 insertions, 66 deletions
diff --git a/python/fatcat_tools/importers/arabesque.py b/python/fatcat_tools/importers/arabesque.py index 7838a7ff..bf9600dc 100644 --- a/python/fatcat_tools/importers/arabesque.py +++ b/python/fatcat_tools/importers/arabesque.py @@ -128,7 +128,7 @@ class ArabesqueMatchImporter(EntityImporter): row['final_url']) urls = [url, ("webarchive", wayback)] - urls = [fatcat_client.FileEntityUrls(rel=rel, url=url) for (rel, url) in urls] + urls = [fatcat_client.FileUrl(rel=rel, url=url) for (rel, url) in urls] if len(urls) > SANE_MAX_URLS: self.counts['skip-too-many-url'] += 1 @@ -177,7 +177,7 @@ class ArabesqueMatchImporter(EntityImporter): # merge the existing into this one and update existing.urls = list(set([(u.rel, u.url) for u in fe.urls + existing.urls])) - existing.urls = [fatcat_client.FileEntityUrls(rel=rel, url=url) for (rel, url) in existing.urls] + existing.urls = [fatcat_client.FileUrl(rel=rel, url=url) for (rel, url) in existing.urls] if len(existing.urls) > SANE_MAX_URLS: self.counts['skip-update-too-many-url'] += 1 return None diff --git a/python/fatcat_tools/importers/cdl_dash_dat.py b/python/fatcat_tools/importers/cdl_dash_dat.py index c1ea075d..9c2bdefc 100755 --- a/python/fatcat_tools/importers/cdl_dash_dat.py +++ b/python/fatcat_tools/importers/cdl_dash_dat.py @@ -39,14 +39,14 @@ def single_file(prefix, path): if guess: mime = guess - fsm = FilesetEntityManifest( + fsf = FilesetFile( path=path, size=size_bytes, md5=hashes[0].hexdigest(), sha1=hashes[1].hexdigest(), sha256=hashes[2].hexdigest(), extra=dict(mimetype=mime)) - return fsm + return fsf def make_manifest(base_dir): manifest = [] @@ -76,7 +76,7 @@ def cdl_dash_release(meta, extra=None): abstracts = [] for desc in meta['descriptions']: if desc['type'] == "abstract": - abstracts.append(ReleaseEntityAbstracts( + abstracts.append(ReleaseAbstract( mimetype="text/html", content=clean(desc['value']))) #print(abstracts) @@ -95,7 +95,7 @@ def cdl_dash_release(meta, extra=None): )) r = ReleaseEntity( - ext_ids=ReleaseEntityExtIds( + ext_ids=ReleaseExtIds( doi=doi, ark=ark_id, ), diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py index c875010c..443879e7 100644 --- a/python/fatcat_tools/importers/crossref.py +++ b/python/fatcat_tools/importers/crossref.py @@ -309,7 +309,7 @@ class CrossrefImporter(EntityImporter): abstracts = [] abstract = clean(obj.get('abstract')) if abstract and len(abstract) > 10: - abstracts.append(fatcat_client.ReleaseEntityAbstracts( + abstracts.append(fatcat_client.ReleaseAbstract( mimetype="application/xml+jats", content=abstract)) @@ -424,7 +424,7 @@ class CrossrefImporter(EntityImporter): release_date=release_date, release_year=release_year, publisher=publisher, - ext_ids=fatcat_client.ReleaseEntityExtIds( + ext_ids=fatcat_client.ReleaseExtIds( doi=obj['DOI'].lower(), pmid=extids['pmid'], pmcid=extids['pmcid'], diff --git a/python/fatcat_tools/importers/grobid_metadata.py b/python/fatcat_tools/importers/grobid_metadata.py index 9e99bc0a..573346a1 100644 --- a/python/fatcat_tools/importers/grobid_metadata.py +++ b/python/fatcat_tools/importers/grobid_metadata.py @@ -82,7 +82,7 @@ class GrobidMetadataImporter(EntityImporter): abstract = obj.get('abstract') if abstract and len(abstract) < MAX_ABSTRACT_BYTES and len(abstract) > 10: - abobj = fatcat_client.ReleaseEntityAbstracts( + abobj = fatcat_client.ReleaseAbstract( mimetype="text/plain", content=clean(obj.get('abstract'))) abstracts = [abobj] @@ -158,7 +158,7 @@ class GrobidMetadataImporter(EntityImporter): volume=clean(obj['journal'].get('volume')), issue=clean(obj['journal'].get('issue')), abstracts=abstracts, - ext_ids=fatcat_client.ReleaseEntityExtIds(), + ext_ids=fatcat_client.ReleaseExtIds(), extra=extra) return re @@ -181,10 +181,10 @@ class GrobidMetadataImporter(EntityImporter): cdx['dt'], original) fe.urls.append( - fatcat_client.FileEntityUrls(url=wayback, rel="webarchive")) + fatcat_client.FileUrl(url=wayback, rel="webarchive")) original_url = make_rel_url(original, default_link_rel=self.default_link_rel) if original_url is not None: - fe.urls.append(fatcat_client.FileEntityUrls(rel=original_url[0], url=original_url[1])) + fe.urls.append(fatcat_client.FileUrl(rel=original_url[0], url=original_url[1])) return fe diff --git a/python/fatcat_tools/importers/matched.py b/python/fatcat_tools/importers/matched.py index 0afd00e3..f3f2e141 100644 --- a/python/fatcat_tools/importers/matched.py +++ b/python/fatcat_tools/importers/matched.py @@ -88,7 +88,7 @@ class MatchedImporter(EntityImporter): url = make_rel_url(original, default_link_rel=self.default_link_rel) if url != None: urls.add(url) - urls = [fatcat_client.FileEntityUrls(rel=rel, url=url) for (rel, url) in urls] + urls = [fatcat_client.FileUrl(rel=rel, url=url) for (rel, url) in urls] if len(urls) == 0: self.counts['skip-no-urls'] += 1 return None @@ -131,7 +131,7 @@ class MatchedImporter(EntityImporter): # merge the existing into this one and update existing.urls = list(set([(u.rel, u.url) for u in fe.urls + existing.urls])) - existing.urls = [fatcat_client.FileEntityUrls(rel=rel, url=url) for (rel, url) in existing.urls] + existing.urls = [fatcat_client.FileUrl(rel=rel, url=url) for (rel, url) in existing.urls] if len(existing.urls) > SANE_MAX_URLS: self.counts['skip-update-too-many-url'] += 1 return None diff --git a/python/fatcat_tools/importers/wayback_static.py b/python/fatcat_tools/importers/wayback_static.py index b4b1111e..73779b95 100755 --- a/python/fatcat_tools/importers/wayback_static.py +++ b/python/fatcat_tools/importers/wayback_static.py @@ -104,7 +104,7 @@ def lookup_cdx(embed_url, verify_hashes=True, cdx_output=None): cdx_output.write(hit + "\n") cdx = hit.split(' ') cdx = [x if (x and x != '-') else None for x in cdx] - webcapture_cdx = WebcaptureEntityCdx( + webcapture_cdx = WebcaptureCdxLine( surt=cdx[0], timestamp=parse_wbm_timestamp(cdx[1]).isoformat() + "Z", url=cdx[2], @@ -166,7 +166,7 @@ def static_wayback_webcapture(wayback_url, cdx_output=None): for url in embeds: cdx_obj = lookup_cdx(url, cdx_output=cdx_output) cdx_list.append(cdx_obj) - archive_urls = [WebcaptureEntityArchiveUrls( + archive_urls = [WebcaptureUrl( rel="wayback", url="https://web.archive.org/web/", )] diff --git a/python/fatcat_web/forms.py b/python/fatcat_web/forms.py index e22476ce..fb7c1116 100644 --- a/python/fatcat_web/forms.py +++ b/python/fatcat_web/forms.py @@ -9,7 +9,7 @@ from wtforms import SelectField, DateField, StringField, IntegerField, \ HiddenField, FormField, FieldList, validators from fatcat_client import ContainerEntity, CreatorEntity, FileEntity, \ - ReleaseEntity, ReleaseContrib, FileEntityUrls, ReleaseEntityExtIds + ReleaseEntity, ReleaseContrib, FileUrl, ReleaseExtIds release_type_options = [ ('', 'Unknown'), @@ -132,7 +132,7 @@ class ReleaseEntityForm(EntityEditForm): def to_entity(self): assert(self.title.data) - entity = ReleaseEntity(title=self.title.data, ext_ids=ReleaseEntityExtIds()) + entity = ReleaseEntity(title=self.title.data, ext_ids=ReleaseExtIds()) self.update_entity(entity) return entity @@ -327,7 +327,7 @@ class FileEntityForm(EntityEditForm): setattr(fe, simple_attr, a) fe.urls = [] for u in self.urls: - fe.urls.append(FileEntityUrls( + fe.urls.append(FileUrl( rel=u.rel.data or None, url=u.url.data or None, )) diff --git a/python/tests/api_entity_state.py b/python/tests/api_entity_state.py index f6350039..7fb9fac1 100644 --- a/python/tests/api_entity_state.py +++ b/python/tests/api_entity_state.py @@ -406,11 +406,11 @@ def test_create_redirect(api): assert "redirect" in e.body # again with releases - r1 = ReleaseEntity(title="test one", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="test one", ext_ids=ReleaseExtIds()) eg = quick_eg(api) r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident) api.accept_editgroup(eg.editgroup_id) - r2 = ReleaseEntity(title="blah", redirect=c1.ident, ext_ids=ReleaseEntityExtIds()) + r2 = ReleaseEntity(title="blah", redirect=c1.ident, ext_ids=ReleaseExtIds()) eg = quick_eg(api) try: api.create_release(r2, editgroup_id=eg.editgroup_id) @@ -443,7 +443,7 @@ def test_required_entity_fields(api): # Release try: - c1 = ReleaseEntity(ext_ids=ReleaseEntityExtIds()) + c1 = ReleaseEntity(ext_ids=ReleaseExtIds()) api.create_release(c1, editgroup_id=eg.editgroup_id) assert False except fatcat_client.rest.ApiException as e: diff --git a/python/tests/api_files.py b/python/tests/api_files.py index 377b5798..5079188d 100644 --- a/python/tests/api_files.py +++ b/python/tests/api_files.py @@ -21,7 +21,7 @@ def test_file(api): mimetype="application/pdf", extra=dict(a=2, b=5), urls=[ - FileEntityUrls(url="https://web.archive.org/web/12345542/something.com/blah.pdf", rel="webarchive"), + FileUrl(url="https://web.archive.org/web/12345542/something.com/blah.pdf", rel="webarchive"), ], release_ids=[], ) diff --git a/python/tests/api_filesets.py b/python/tests/api_filesets.py index ac233b14..7838d769 100644 --- a/python/tests/api_filesets.py +++ b/python/tests/api_filesets.py @@ -11,12 +11,12 @@ from fixtures import * def test_fileset(api): eg = quick_eg(api) - r1 = ReleaseEntity(title="test fileset release", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="test fileset release", ext_ids=ReleaseExtIds()) r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id) fs1 = FilesetEntity( manifest = [ - FilesetEntityManifest( + FilesetFile( path="data/thing.tar.gz", size=54321, md5="540da3ea6e448d8dfb057c05225f853a", @@ -24,7 +24,7 @@ def test_fileset(api): sha256="c7b49f3e84cd1b7cb0b0e3e9f632b7be7e21b4dc229df23331f880a8a7dfa75a", extra={"a": 1, "b": 3}, ), - FilesetEntityManifest( + FilesetFile( path="README.md", size=54210, md5="5f83592b5249671719bbed6ce91ecfa8", @@ -34,8 +34,8 @@ def test_fileset(api): ), ], urls = [ - FileEntityUrls(url="https://archive.org/download/fileset-123/", rel="repository"), - FileEntityUrls(url="https://humble-host.com/~user123/dataset/", rel="web"), + FilesetUrl(url="https://archive.org/download/fileset-123/", rel="repository"), + FilesetUrl(url="https://humble-host.com/~user123/dataset/", rel="web"), ], release_ids = [r1edit.ident], ) @@ -82,9 +82,9 @@ def test_bad_fileset(api): bad_list = [ # good (for testing test itself) - #FilesetEntity(manifest=[FilesetEntityManifest(path="123.jpg", size=1234)]), - #FilesetEntity(urls=[FileEntityUrls(url="thing", rel="blah")]), - FilesetEntity(manifest=[FilesetEntityManifest(path="123.jpg", size="big")]), + #FilesetEntity(manifest=[FilesetFile(path="123.jpg", size=1234)]), + #FilesetEntity(urls=[FilesetUrl(url="thing", rel="blah")]), + FilesetEntity(manifest=[FilesetFile(path="123.jpg", size="big")]), FilesetEntity(release_ids=["asdf"]), ] diff --git a/python/tests/api_releases.py b/python/tests/api_releases.py index 52a4a548..5965ae4e 100644 --- a/python/tests/api_releases.py +++ b/python/tests/api_releases.py @@ -25,7 +25,7 @@ def test_release(api): withdrawn_status="withdrawn", withdrawn_year=2017, withdrawn_date="2017-04-10", - ext_ids=ReleaseEntityExtIds( + ext_ids=ReleaseExtIds( doi="10.5555/12345678", pmid="12345", pmcid="PMC4321", @@ -59,11 +59,11 @@ def test_release(api): ], refs=[], abstracts=[ - ReleaseEntityAbstracts( + ReleaseAbstract( content="this is some abstract", mimetype="text/plain", lang="en"), - ReleaseEntityAbstracts( + ReleaseAbstract( content="this is some other abstract", mimetype="text/plain", lang="de"), @@ -177,27 +177,27 @@ def test_empty_fields(api): r1 = ReleaseEntity( title="something", contribs=[ReleaseContrib(raw_name="somebody")], - ext_ids=ReleaseEntityExtIds()) + ext_ids=ReleaseExtIds()) r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id) with pytest.raises(fatcat_client.rest.ApiException): - r2 = ReleaseEntity(title="", ext_ids=ReleaseEntityExtIds()) + r2 = ReleaseEntity(title="", ext_ids=ReleaseExtIds()) api.create_release(r2, editgroup_id=eg.editgroup_id) with pytest.raises(fatcat_client.rest.ApiException): - r2 = ReleaseEntity(title="something", contribs=[ReleaseContrib(raw_name="")], ext_ids=ReleaseEntityExtIds()) + r2 = ReleaseEntity(title="something", contribs=[ReleaseContrib(raw_name="")], ext_ids=ReleaseExtIds()) api.create_release(r2, editgroup_id=eg.editgroup_id) def test_controlled_vocab(api): eg = quick_eg(api) - r1 = ReleaseEntity(title="something", release_type="journal-thingie", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="something", release_type="journal-thingie", ext_ids=ReleaseExtIds()) with pytest.raises(fatcat_client.rest.ApiException): api.create_release(r1, editgroup_id=eg.editgroup_id) r1.release_type = "article" api.create_release(r1, editgroup_id=eg.editgroup_id) - r2 = ReleaseEntity(title="something elase", release_stage="pre-print", ext_ids=ReleaseEntityExtIds()) + r2 = ReleaseEntity(title="something elase", release_stage="pre-print", ext_ids=ReleaseExtIds()) with pytest.raises(fatcat_client.rest.ApiException): api.create_release(r2, editgroup_id=eg.editgroup_id) r2.release_stage = "published" diff --git a/python/tests/api_webcaptures.py b/python/tests/api_webcaptures.py index 8c685b30..896c9d8a 100644 --- a/python/tests/api_webcaptures.py +++ b/python/tests/api_webcaptures.py @@ -12,7 +12,7 @@ from fixtures import * def test_webcapture(api): eg = quick_eg(api) - r1 = ReleaseEntity(title="test webcapture release", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="test webcapture release", ext_ids=ReleaseExtIds()) r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id) wc1 = WebcaptureEntity( @@ -20,7 +20,7 @@ def test_webcapture(api): #timestamp = "2012-01-02T03:04:05Z", timestamp = datetime.datetime.now(datetime.timezone.utc), cdx = [ - WebcaptureEntityCdx( + WebcaptureCdxLine( surt="site,example,)/data/thing.tar.gz", #timestamp="2012-01-02T03:04:05Z", timestamp=datetime.datetime.now(datetime.timezone.utc), @@ -31,7 +31,7 @@ def test_webcapture(api): sha1="455face3598611458efe1f072e58624790a67266", sha256="c7b49f3e84cd1b7cb0b0e3e9f632b7be7e21b4dc229df23331f880a8a7dfa75a", ), - WebcaptureEntityCdx( + WebcaptureCdxLine( surt="site,example,)/README.md", #timestamp="2012-01-02T03:04:05Z", timestamp=datetime.datetime.now(datetime.timezone.utc), @@ -44,7 +44,7 @@ def test_webcapture(api): ), ], archive_urls = [ - FileEntityUrls(rel="wayback", url="https://web.archive.org/web/"), + FileUrl(rel="wayback", url="https://web.archive.org/web/"), ], release_ids = [r1edit.ident], ) @@ -104,7 +104,7 @@ def test_bad_webcapture(api): good = WebcaptureEntity( original_url="http://example.site/123.jpg", timestamp="2012-01-02T03:04:05Z", - cdx=[WebcaptureEntityCdx( + cdx=[WebcaptureCdxLine( surt="site,example,)/123.jpg", url="http://example.site/123.jpg", sha1="455face3598611458efe1f072e58624790a67266", @@ -117,7 +117,7 @@ def test_bad_webcapture(api): WebcaptureEntity( original_url="http://example.site/123.jpg", timestamp="2012-01-02T03:04:05Z", - cdx=[WebcaptureEntityCdx( + cdx=[WebcaptureCdxLine( surt="site,example,)/123.jpg", url="http://example.site/123.jpg", sha1="455face3598611458efe1f072e58624790a67266", @@ -127,7 +127,7 @@ def test_bad_webcapture(api): WebcaptureEntity( original_url="http://example.site/123.jpg", timestamp="2012-01-02T03:04:05Z", - cdx=[WebcaptureEntityCdx( + cdx=[WebcaptureCdxLine( surt="site,example,)/123.jpg", url="http://example.site/123.jpg", sha1="455face3598611458efe1f072e58624790a67266", @@ -136,7 +136,7 @@ def test_bad_webcapture(api): WebcaptureEntity( original_url="http://example.site/123.jpg", timestamp="2012-01-02T03:04:05Z", - cdx=[WebcaptureEntityCdx( + cdx=[WebcaptureCdxLine( surt="site,example,)/123.jpg", url="http://example.site/123.jpg", sha1="455face3598611458efe1f072e58624790a67266", @@ -154,7 +154,7 @@ def test_bad_webcapture(api): WebcaptureEntity( original_url="http://example.site/123.jpg", timestamp="2012-01-02T03:04:05Z", - cdx=[WebcaptureEntityCdx( + cdx=[WebcaptureCdxLine( #url="http://example.site/123.jpg", surt="site,example,)/123.jpg", sha1="455face3598611458efe1f072e58624790a67266", @@ -166,7 +166,7 @@ def test_bad_webcapture(api): WebcaptureEntity( original_url="http://example.site/123.jpg", timestamp="2012-01-02T03:04:05Z", - cdx=[WebcaptureEntityCdx( + cdx=[WebcaptureCdxLine( url="http://example.site/123.jpg", surt="site,example,)/123.jpg", sha1="455face3598611458efe1f072e58624790a67266", diff --git a/python/tests/citation_efficiency.py b/python/tests/citation_efficiency.py index 200644cc..e4add80c 100644 --- a/python/tests/citation_efficiency.py +++ b/python/tests/citation_efficiency.py @@ -12,7 +12,7 @@ def test_citation_indexing(api): # indexing is consistent and reacts to change eg = quick_eg(api) - r1 = ReleaseEntity(title="the target", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="the target", ext_ids=ReleaseExtIds()) r1.refs = [ ReleaseRef(key="first", title="the first title"), ReleaseRef(key="second", title="the second title"), @@ -44,9 +44,9 @@ def test_citation_targets(api): # also, updates work eg = quick_eg(api) - r1 = ReleaseEntity(title="the target", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="the target", ext_ids=ReleaseExtIds()) r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident) - r2 = ReleaseEntity(title="the citer", ext_ids=ReleaseEntityExtIds()) + r2 = ReleaseEntity(title="the citer", ext_ids=ReleaseExtIds()) r2.refs = [ ReleaseRef(key="first", title="something else"), ReleaseRef(key="second", title="the target title"), @@ -70,8 +70,8 @@ def test_citation_targets(api): def test_citation_empty_array(api): # distinction between empty array (no citations) and no array (hidden) - r1 = ReleaseEntity(title="citation null", ext_ids=ReleaseEntityExtIds()) - r2 = ReleaseEntity(title="citation empty array", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="citation null", ext_ids=ReleaseExtIds()) + r2 = ReleaseEntity(title="citation empty array", ext_ids=ReleaseExtIds()) r1.refs = None r2.refs = [] @@ -91,7 +91,7 @@ def test_citation_empty_array(api): def test_citation_encoding(api): # escape-only changes (eg, \u1234 whatever for ASCII) - r1 = ReleaseEntity(title="citation encoding", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="citation encoding", ext_ids=ReleaseExtIds()) title = "title-unicode \\u0050 \\\" " container = "container-unicode ☃︎ ä ö ü スティー" extra = extra={'a': 1, 'b': 2, 'ö': 3} diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py index 6835b7a6..0a014823 100644 --- a/python/tests/fixtures.py +++ b/python/tests/fixtures.py @@ -48,7 +48,7 @@ def api_dummy_entities(api): c1 = CreatorEntity(display_name="test creator deletion") j1 = ContainerEntity(name="test journal deletion") - r1 = ReleaseEntity(title="test release creator deletion", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="test release creator deletion", ext_ids=ReleaseExtIds()) f1 = FileEntity() fs1 = FilesetEntity() wc1 = WebcaptureEntity( diff --git a/python/tests/subentity_state.py b/python/tests/subentity_state.py index a248b296..2b71e04a 100644 --- a/python/tests/subentity_state.py +++ b/python/tests/subentity_state.py @@ -27,8 +27,8 @@ def test_relation_states(api, app): j1 = ContainerEntity(name="test journal") j2 = ContainerEntity(name="another test journal") c1 = CreatorEntity(display_name="test person") - r1 = ReleaseEntity(title="test article", ext_ids=ReleaseEntityExtIds()) - r2 = ReleaseEntity(title="another test article", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="test article", ext_ids=ReleaseExtIds()) + r2 = ReleaseEntity(title="another test article", ext_ids=ReleaseExtIds()) f1 = FileEntity(md5="c60f5b093ef5e6caad9d7b45268be409") f2 = FileEntity(md5="0000000000000000ad9d7b45268be409") @@ -100,7 +100,7 @@ def test_relation_states(api, app): r2 = api.get_release(r2.ident, expand="container,creators,files") assert r2.files == [] eg = quick_eg(api) - api.update_release(r2.ident, ReleaseEntity(redirect=r1.ident, ext_ids=ReleaseEntityExtIds()), editgroup_id=eg.editgroup_id) + api.update_release(r2.ident, ReleaseEntity(redirect=r1.ident, ext_ids=ReleaseExtIds()), editgroup_id=eg.editgroup_id) f2.release_ids = [r2.ident] f2 = api.get_file(api.create_file(f2, editgroup_id=eg.editgroup_id).ident) api.accept_editgroup(eg.editgroup_id) @@ -140,8 +140,8 @@ def test_app_entity_states(api, app): j2 = ContainerEntity(name="another test journal") c1 = CreatorEntity(display_name="test person") c2 = CreatorEntity(display_name="another test person") - r1 = ReleaseEntity(title="test article", ext_ids=ReleaseEntityExtIds()) - r2 = ReleaseEntity(title="another test article", ext_ids=ReleaseEntityExtIds()) + r1 = ReleaseEntity(title="test article", ext_ids=ReleaseExtIds()) + r2 = ReleaseEntity(title="another test article", ext_ids=ReleaseExtIds()) f1 = FileEntity(md5="c60f5b093ef5e6caad9d7b45268be409") f2 = FileEntity(md5="0000000000000000ad9d7b45268be409") @@ -165,7 +165,7 @@ def test_app_entity_states(api, app): api.update_container(j2.ident, ContainerEntity(redirect=j1.ident), editgroup_id=eg.editgroup_id) api.update_creator(c2.ident, CreatorEntity(redirect=c1.ident), editgroup_id=eg.editgroup_id) api.update_file(f2.ident, FileEntity(redirect=f1.ident), editgroup_id=eg.editgroup_id) - api.update_release(r2.ident, ReleaseEntity(redirect=r1.ident, ext_ids=ReleaseEntityExtIds()), editgroup_id=eg.editgroup_id) + api.update_release(r2.ident, ReleaseEntity(redirect=r1.ident, ext_ids=ReleaseExtIds()), editgroup_id=eg.editgroup_id) api.update_work(r2.work_id, WorkEntity(redirect=r1.work_id), editgroup_id=eg.editgroup_id) api.accept_editgroup(eg.editgroup_id) diff --git a/python/tests/transform_tests.py b/python/tests/transform_tests.py index 15541a23..27f54d92 100644 --- a/python/tests/transform_tests.py +++ b/python/tests/transform_tests.py @@ -21,7 +21,7 @@ def test_rich_elasticsearch_convert(crossref_importer): title="something", release_year=1234, license_slug="CC-BY-NC", - ext_ids=ReleaseEntityExtIds(), + ext_ids=ReleaseExtIds(), ) r.state = 'active' r.container = ContainerEntity( @@ -47,9 +47,9 @@ def test_rich_elasticsearch_convert(crossref_importer): r.files = [FileEntity( mimetype="application/pdf", urls=[ - FileEntityUrls(rel="dweb", url="dat://a954329dlk/thingie"), - FileEntityUrls(rel="webarchive", url="https://web.archive.org/web/20001122030405/http://example.com"), - FileEntityUrls(rel="web", url="https://archive.org/details/blah/file.pdf"), + FileUrl(rel="dweb", url="dat://a954329dlk/thingie"), + FileUrl(rel="webarchive", url="https://web.archive.org/web/20001122030405/http://example.com"), + FileUrl(rel="web", url="https://archive.org/details/blah/file.pdf"), ], extra={ "shadows": {}, |