summaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-14 18:01:27 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-14 18:01:27 -0700
commit7c18e1d22b16bb920c9bb9a788691820bbdb2bfa (patch)
tree0e623bc4442f8a36267607a8f32106a3f241ee9c /python/tests
parent1e0e890284978dc7379db707ed1fa2c902e297c6 (diff)
downloadfatcat-7c18e1d22b16bb920c9bb9a788691820bbdb2bfa.tar.gz
fatcat-7c18e1d22b16bb920c9bb9a788691820bbdb2bfa.zip
python impl
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/api_containers.py4
-rw-r--r--python/tests/api_creators.py4
-rw-r--r--python/tests/api_editgroups.py61
-rw-r--r--python/tests/api_entity_editing.py46
-rw-r--r--python/tests/api_entity_state.py86
-rw-r--r--python/tests/api_files.py4
-rw-r--r--python/tests/api_filesets.py8
-rw-r--r--python/tests/api_misc.py2
-rw-r--r--python/tests/api_releases.py18
-rw-r--r--python/tests/api_webcaptures.py10
-rw-r--r--python/tests/citation_efficiency.py16
-rw-r--r--python/tests/fixtures.py12
-rw-r--r--python/tests/subentity_state.py58
13 files changed, 153 insertions, 176 deletions
diff --git a/python/tests/api_containers.py b/python/tests/api_containers.py
index 47825ed5..435c76af 100644
--- a/python/tests/api_containers.py
+++ b/python/tests/api_containers.py
@@ -21,7 +21,7 @@ def test_container(api):
extra=dict(a=1, b=2),
)
- c1edit = api.create_container(c1, editgroup_id=eg.editgroup_id)
+ c1edit = api.create_container(eg.editgroup_id, c1)
api.accept_editgroup(eg.editgroup_id)
c2 = api.get_container(c1edit.ident)
@@ -44,7 +44,7 @@ def test_container(api):
# delete
eg = quick_eg(api)
- api.delete_container(c2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_container(eg.editgroup_id, c2.ident)
api.accept_editgroup(eg.editgroup_id)
c2 = api.get_container(c2.ident)
assert c2.state == "deleted"
diff --git a/python/tests/api_creators.py b/python/tests/api_creators.py
index 91eedd24..b3e1194c 100644
--- a/python/tests/api_creators.py
+++ b/python/tests/api_creators.py
@@ -21,7 +21,7 @@ def test_creators(api):
extra=dict(a=1, b=5),
)
- c1edit = api.create_creator(c1, editgroup_id=eg.editgroup_id)
+ c1edit = api.create_creator(eg.editgroup_id, c1)
api.accept_editgroup(eg.editgroup_id)
c2 = api.get_creator(c1edit.ident)
@@ -44,7 +44,7 @@ def test_creators(api):
# delete
eg = quick_eg(api)
- api.delete_creator(c2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c2.ident)
api.accept_editgroup(eg.editgroup_id)
c2 = api.get_creator(c2.ident)
assert c2.state == "deleted"
diff --git a/python/tests/api_editgroups.py b/python/tests/api_editgroups.py
index 722d8686..5346d909 100644
--- a/python/tests/api_editgroups.py
+++ b/python/tests/api_editgroups.py
@@ -15,7 +15,7 @@ def test_editgroup_submit(api):
c1 = CreatorEntity(display_name="test updates")
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
eg2 = api.get_editgroup(eg.editgroup_id)
assert not eg2.submitted
@@ -86,55 +86,32 @@ def test_editgroup_ordering(api):
assert r1[0].submitted <= r1[1].submitted
-def test_editgroup_autoaccept(api):
- # autoaccept changes: editgroups required when, in what combination
+def test_editgroup_auto_batch(api):
- eg = quick_eg(api)
- c1 = CreatorEntity(display_name="test autoaccept")
- c2 = CreatorEntity(display_name="test another autoaccept")
-
- with pytest.raises(fatcat_client.rest.ApiException):
- edits = api.create_creator_batch([c1, c2])
+ c1 = CreatorEntity(display_name="test auto_batch")
+ c2 = CreatorEntity(display_name="test another auto_batch")
- with pytest.raises(fatcat_client.rest.ApiException):
- edits = api.create_creator_batch([c1, c2], editgroup_id=eg.editgroup_id, autoaccept=True)
+ eg1 = api.create_creator_auto_batch(CreatorAutoBatch(
+ editgroup=Editgroup(),
+ entity_list=[c1, c2]))
- edits1 = api.create_creator_batch([c1, c2], editgroup_id=eg.editgroup_id)
- edits2 = api.create_creator_batch([c1, c2], autoaccept=True)
-
- assert edits1[0].editgroup_id == eg.editgroup_id
- assert edits1[0].editgroup_id != edits2[1].editgroup_id
- eg1 = api.get_editgroup(edits1[0].editgroup_id)
- eg2 = api.get_editgroup(edits2[0].editgroup_id)
-
- assert not eg1.changelog_index
- assert eg2.changelog_index
- #print(edits1)
- #print(eg1.edits.creators)
- assert eg1.edits.creators[0].ident in [t.ident for t in edits1]
- assert eg2.edits.creators[0].ident in [t.ident for t in edits2]
+ assert eg1.changelog_index
+ assert len(eg1.edits.creators) == 2
def test_batch_params(api):
eg = quick_eg(api)
- c1 = CreatorEntity(display_name="test autoaccept")
- c2 = CreatorEntity(display_name="test another autoaccept")
-
- with pytest.raises(fatcat_client.rest.ApiException):
- edits = api.create_creator_batch([c1, c2])
+ c1 = CreatorEntity(display_name="test auto_batch")
+ c2 = CreatorEntity(display_name="test another auto_batch")
desc = "test description"
extra = dict(a=75, q="thing")
- edits = api.create_creator_batch([c1, c2], autoaccept=True, description=desc, extra=json.dumps(extra))
- eg = api.get_editgroup(edits[0].editgroup_id)
-
- assert eg.description == desc
- assert eg.extra == extra
-
- # currently must manually json dumps() extra field
- with pytest.raises(fatcat_client.rest.ApiException):
- api.create_creator_batch([c1, c2], autoaccept=True, description=desc, extra=extra)
-
- with pytest.raises(fatcat_client.rest.ApiException):
- api.create_creator_batch([c1, c2], autoaccept=True, description=desc, extra="{")
+ eg1 = api.create_creator_auto_batch(CreatorAutoBatch(
+ editgroup=Editgroup(
+ description=desc,
+ extra=extra),
+ entity_list=[c1, c2]))
+
+ assert eg1.description == desc
+ assert eg1.extra == extra
diff --git a/python/tests/api_entity_editing.py b/python/tests/api_entity_editing.py
index eff0ca30..83f38695 100644
--- a/python/tests/api_entity_editing.py
+++ b/python/tests/api_entity_editing.py
@@ -14,20 +14,20 @@ def test_multiple_edits_same_group(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# try multiple edits in the same group
eg = quick_eg(api)
c2 = CreatorEntity(display_name="left")
c3 = CreatorEntity(display_name="right")
- edit = api.update_creator(c1.ident, c2, editgroup_id=eg.editgroup_id)
+ edit = api.update_creator(eg.editgroup_id, c1.ident, c2)
# should fail with existing
with pytest.raises(fatcat_client.rest.ApiException):
- api.update_creator(c1.ident, c3, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c1.ident, c3)
# ... but succeed after deleting
- api.delete_creator_edit(edit.edit_id)
- api.update_creator(c1.ident, c3, editgroup_id=eg.editgroup_id)
+ api.delete_creator_edit(edit.editgroup_id, edit.edit_id)
+ api.update_creator(eg.editgroup_id, c1.ident, c3)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
assert res.display_name == "right"
@@ -36,7 +36,7 @@ def test_multiple_edits_same_group(api):
# cleanup
eg = quick_eg(api)
- api.delete_creator(c1.ident, eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
api.accept_editgroup(eg.editgroup_id)
@@ -46,13 +46,13 @@ def test_edit_after_accept(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# should be unable to create an edit on an old editgroup
c2 = CreatorEntity(display_name="left")
try:
- api.create_creator(c2, editgroup_id=eg.editgroup_id)
+ api.create_creator(eg.editgroup_id, c2)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -61,7 +61,7 @@ def test_edit_after_accept(api):
# cleanup
eg = quick_eg(api)
- api.delete_creator(c1.ident, eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
api.accept_editgroup(eg.editgroup_id)
@@ -71,7 +71,7 @@ def test_edit_deletion(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# try multiple edits in the same group
@@ -79,10 +79,10 @@ def test_edit_deletion(api):
eg = quick_eg(api)
eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 0
- edit = api.update_creator(c1.ident, c2, editgroup_id=eg.editgroup_id)
+ edit = api.update_creator(eg.editgroup_id, c1.ident, c2)
eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 1
- api.delete_creator_edit(edit.edit_id)
+ api.delete_creator_edit(edit.editgroup_id, edit.edit_id)
eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 0
@@ -94,7 +94,7 @@ def test_edit_deletion(api):
# cleanup
eg = quick_eg(api)
- api.delete_creator(c1.ident, eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
api.accept_editgroup(eg.editgroup_id)
@@ -109,12 +109,12 @@ def test_delete_accepted_edit(api):
# create
eg = quick_eg(api)
- edit = api.create_creator(c1, editgroup_id=eg.editgroup_id)
+ edit = api.create_creator(eg.editgroup_id, c1)
api.accept_editgroup(eg.editgroup_id)
# try to delete
try:
- api.delete_creator_edit(edit.edit_id)
+ api.delete_creator_edit(edit.editgroup_id, edit.edit_id)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -127,7 +127,7 @@ def test_wip_revision(api):
# fetch revision before accepting
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
rev = api.get_creator_revision(c1.revision)
assert "nugget" in rev.display_name
assert rev.state is None
@@ -163,13 +163,13 @@ def test_edit_delete_all(api_dummy_entities):
api = ade['api']
eg = api.get_editgroup(ade['editgroup'].editgroup_id)
- api.delete_creator_edit(eg.edits.creators[0].edit_id)
- api.delete_container_edit(eg.edits.containers[0].edit_id)
- api.delete_file_edit(eg.edits.files[0].edit_id)
- api.delete_fileset_edit(eg.edits.filesets[0].edit_id)
- api.delete_webcapture_edit(eg.edits.webcaptures[0].edit_id)
- api.delete_release_edit(eg.edits.releases[0].edit_id)
- api.delete_work_edit(eg.edits.works[0].edit_id)
+ api.delete_creator_edit(eg.editgroup_id, eg.edits.creators[0].edit_id)
+ api.delete_container_edit(eg.editgroup_id, eg.edits.containers[0].edit_id)
+ api.delete_file_edit(eg.editgroup_id, eg.edits.files[0].edit_id)
+ api.delete_fileset_edit(eg.editgroup_id, eg.edits.filesets[0].edit_id)
+ api.delete_webcapture_edit(eg.editgroup_id, eg.edits.webcaptures[0].edit_id)
+ api.delete_release_edit(eg.editgroup_id, eg.edits.releases[0].edit_id)
+ api.delete_work_edit(eg.editgroup_id, eg.edits.works[0].edit_id)
# verify deletion
eg = api.get_editgroup(ade['editgroup'].editgroup_id)
diff --git a/python/tests/api_entity_state.py b/python/tests/api_entity_state.py
index 7fb9fac1..9ff99dab 100644
--- a/python/tests/api_entity_state.py
+++ b/python/tests/api_entity_state.py
@@ -37,8 +37,8 @@ def test_redirect_entity(api):
# create two creators
eg = quick_eg(api)
- c1_edit = api.create_creator(c1, editgroup_id=eg.editgroup_id)
- c2_edit = api.create_creator(c2, editgroup_id=eg.editgroup_id)
+ c1_edit = api.create_creator(eg.editgroup_id, c1)
+ c2_edit = api.create_creator(eg.editgroup_id, c2)
c1 = api.get_creator(c1_edit.ident)
c2 = api.get_creator(c2_edit.ident)
assert c1_edit.prev_revision is None
@@ -50,7 +50,7 @@ def test_redirect_entity(api):
# merge second into first
c2_redirect = CreatorEntity(redirect=c1.ident)
eg = quick_eg(api)
- merge_edit = api.update_creator(c2.ident, c2_redirect, editgroup_id=eg.editgroup_id)
+ merge_edit = api.update_creator(eg.editgroup_id, c2.ident, c2_redirect)
assert merge_edit.prev_revision == c2.revision
redirs = api.get_creator_redirects(c1.ident)
assert redirs == []
@@ -76,7 +76,7 @@ def test_redirect_entity(api):
# update first; check that get on second updates
c1.display_name = "test one one"
eg = quick_eg(api)
- update_edit = api.update_creator(c1.ident, c1, editgroup_id=eg.editgroup_id)
+ update_edit = api.update_creator(eg.editgroup_id, c1.ident, c1)
assert update_edit.prev_revision == c1.revision
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c2.ident)
@@ -85,7 +85,7 @@ def test_redirect_entity(api):
# delete first; check that second is deleted (but state is redirect)
eg = quick_eg(api)
- del_edit = api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
+ del_edit = api.delete_creator(eg.editgroup_id, c1.ident)
assert del_edit.prev_revision == update_edit.revision
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
@@ -100,7 +100,7 @@ def test_redirect_entity(api):
# undelete first; check that second is a redirect
eg = quick_eg(api)
- undelete_edit = api.update_creator(c1.ident, c1, editgroup_id=eg.editgroup_id)
+ undelete_edit = api.update_creator(eg.editgroup_id, c1.ident, c1)
assert undelete_edit.prev_revision is None
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c2.ident)
@@ -113,7 +113,7 @@ def test_redirect_entity(api):
assert c2.revision
assert c2.redirect is None
eg = quick_eg(api)
- update_edit = api.update_creator(c2.ident, c2, editgroup_id=eg.editgroup_id)
+ update_edit = api.update_creator(eg.editgroup_id, c2.ident, c2)
# prev_revision should be none after an un-redirect
assert update_edit.prev_revision is None
redirs = api.get_creator_redirects(c1.ident)
@@ -129,8 +129,8 @@ def test_redirect_entity(api):
# cleanup
eg = quick_eg(api)
- api.delete_creator(c1.ident, eg.editgroup_id)
- api.delete_creator(c2.ident, eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
+ api.delete_creator(eg.editgroup_id, c2.ident)
api.accept_editgroup(eg.editgroup_id)
@@ -151,7 +151,7 @@ def test_delete_entity(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
assert res.state == "active"
@@ -162,10 +162,10 @@ def test_delete_entity(api):
# delete
eg = quick_eg(api)
- api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
with pytest.raises(fatcat_client.rest.ApiException):
# can't re-delete in same editgroup
- api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
assert res.state == "deleted"
@@ -177,7 +177,7 @@ def test_delete_entity(api):
eg = quick_eg(api)
try:
# can't re-delete an entity
- api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
#api.accept_editgroup(eg.editgroup_id)
assert False
except fatcat_client.rest.ApiException as e:
@@ -185,7 +185,7 @@ def test_delete_entity(api):
# undelete
eg = quick_eg(api)
- api.update_creator(c1.ident, c1, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c1.ident, c1)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
assert res.state == "active"
@@ -196,7 +196,7 @@ def test_delete_entity(api):
# cleanup
eg = quick_eg(api)
- api.delete_creator(c1.ident, eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
api.accept_editgroup(eg.editgroup_id)
@@ -231,9 +231,9 @@ def test_recursive_redirects_entity(api):
# create three creators
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
- c2 = api.get_creator(api.create_creator(c2, editgroup_id=eg.editgroup_id).ident)
- c3 = api.get_creator(api.create_creator(c3, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
+ c2 = api.get_creator(api.create_creator(eg.editgroup_id, c2).ident)
+ c3 = api.get_creator(api.create_creator(eg.editgroup_id, c3).ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c3.ident)
assert res.display_name == "test three"
@@ -241,7 +241,7 @@ def test_recursive_redirects_entity(api):
# redirect third to second
c3_redirect = CreatorEntity(redirect=c2.ident)
eg = quick_eg(api)
- api.update_creator(c3.ident, c3_redirect, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c3.ident, c3_redirect)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c3.ident)
assert res.display_name == "test two"
@@ -249,7 +249,7 @@ def test_recursive_redirects_entity(api):
# redirect second to first: should be an error at merge time
c2_redirect = CreatorEntity(redirect=c1.ident)
eg = quick_eg(api)
- api.update_creator(c2.ident, c2_redirect, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c2.ident, c2_redirect)
with pytest.raises(fatcat_client.rest.ApiException):
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c2.ident)
@@ -262,7 +262,7 @@ def test_recursive_redirects_entity(api):
# redirect first to third: should be an error at merge time
c1_redirect = CreatorEntity(redirect=c3.ident)
eg = quick_eg(api)
- api.update_creator(c1.ident, c1_redirect, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c1.ident, c1_redirect)
with pytest.raises(fatcat_client.rest.ApiException):
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
@@ -271,7 +271,7 @@ def test_recursive_redirects_entity(api):
# update second; check that third updated
c2.display_name = "test two updated"
eg = quick_eg(api)
- api.update_creator(c2.ident, c2, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c2.ident, c2)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c2.ident)
c2 = res
@@ -284,7 +284,7 @@ def test_recursive_redirects_entity(api):
# delete second; check that third updated
eg = quick_eg(api)
- api.delete_creator(c2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c2.ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c2.ident)
assert res.state == "deleted"
@@ -297,7 +297,7 @@ def test_recursive_redirects_entity(api):
# undelete second; check that third updated
eg = quick_eg(api)
c2_undelete = CreatorEntity(revision=c2.revision)
- api.update_creator(c2.ident, c2_undelete, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c2.ident, c2_undelete)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c2.ident)
assert res.state == "active"
@@ -308,7 +308,7 @@ def test_recursive_redirects_entity(api):
# delete third (a redirect)
eg = quick_eg(api)
- api.delete_creator(c3.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c3.ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c3.ident)
assert res.state == "deleted"
@@ -316,7 +316,7 @@ def test_recursive_redirects_entity(api):
# re-redirect third
eg = quick_eg(api)
- api.update_creator(c3.ident, c3_redirect, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c3.ident, c3_redirect)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c3.ident)
assert res.state == "redirect"
@@ -324,7 +324,7 @@ def test_recursive_redirects_entity(api):
# delete second, then delete third
eg = quick_eg(api)
- api.delete_creator(c2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c2.ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c3.ident)
assert res.state == "redirect"
@@ -332,7 +332,7 @@ def test_recursive_redirects_entity(api):
with pytest.raises(fatcat_client.rest.ApiException):
res = api.lookup_creator(orcid=o2)
eg = quick_eg(api)
- api.delete_creator(c3.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c3.ident)
api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c3.ident)
assert res.state == "deleted"
@@ -340,7 +340,7 @@ def test_recursive_redirects_entity(api):
# cleanup
eg = quick_eg(api)
- api.delete_creator(c1.ident, eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
# c2 already deleted
# c3 already deleted
api.accept_editgroup(eg.editgroup_id)
@@ -352,14 +352,14 @@ def test_self_redirect(api):
# create creator
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# redirect first to itself; should error on PUT
c1_redirect = CreatorEntity(redirect=c1.ident)
eg = quick_eg(api)
with pytest.raises(fatcat_client.rest.ApiException):
- merge_edit = api.update_creator(c1.ident, c1_redirect, editgroup_id=eg.editgroup_id)
+ merge_edit = api.update_creator(eg.editgroup_id, c1.ident, c1_redirect)
def test_wip_redirect(api):
@@ -367,20 +367,20 @@ def test_wip_redirect(api):
# create first
c1 = CreatorEntity(display_name="test one")
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# start creating second entity
c2 = CreatorEntity(display_name="test two")
eg = quick_eg(api)
- c2 = api.get_creator(api.create_creator(c2, editgroup_id=eg.editgroup_id).ident)
+ c2 = api.get_creator(api.create_creator(eg.editgroup_id, c2).ident)
assert c2.state == "wip"
# redirect first to second (should fail)
eg = quick_eg(api)
c1_redirect = CreatorEntity(redirect=c2.ident)
try:
- api.update_creator(c1.ident, c1_redirect, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c1.ident, c1_redirect)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -392,14 +392,14 @@ def test_create_redirect(api):
# create first
c1 = CreatorEntity(display_name="test one")
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# create second
c2 = CreatorEntity(display_name="blah", redirect=c1.ident)
eg = quick_eg(api)
try:
- api.create_creator(c2, editgroup_id=eg.editgroup_id)
+ api.create_creator(eg.editgroup_id, c2)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -408,12 +408,12 @@ def test_create_redirect(api):
# again with releases
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)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
api.accept_editgroup(eg.editgroup_id)
r2 = ReleaseEntity(title="blah", redirect=c1.ident, ext_ids=ReleaseExtIds())
eg = quick_eg(api)
try:
- api.create_release(r2, editgroup_id=eg.editgroup_id)
+ api.create_release(eg.editgroup_id, r2)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -426,7 +426,7 @@ def test_required_entity_fields(api):
# Creator
try:
c1 = CreatorEntity()
- api.create_creator(c1, editgroup_id=eg.editgroup_id)
+ api.create_creator(eg.editgroup_id, c1)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -435,7 +435,7 @@ def test_required_entity_fields(api):
# Container
try:
c1 = ContainerEntity()
- api.create_container(c1, editgroup_id=eg.editgroup_id)
+ api.create_container(eg.editgroup_id, c1)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -444,7 +444,7 @@ def test_required_entity_fields(api):
# Release
try:
c1 = ReleaseEntity(ext_ids=ReleaseExtIds())
- api.create_release(c1, editgroup_id=eg.editgroup_id)
+ api.create_release(eg.editgroup_id, c1)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -456,14 +456,14 @@ def test_revert_current_status(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
api.accept_editgroup(eg.editgroup_id)
# try to "revert" to current revision
eg = quick_eg(api)
c1_revert = CreatorEntity(revision=c1.revision)
try:
- api.update_creator(c1.ident, c1_revert, editgroup_id=eg.editgroup_id)
+ api.update_creator(eg.editgroup_id, c1.ident, c1_revert)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
diff --git a/python/tests/api_files.py b/python/tests/api_files.py
index 5079188d..8d7c94d5 100644
--- a/python/tests/api_files.py
+++ b/python/tests/api_files.py
@@ -26,7 +26,7 @@ def test_file(api):
release_ids=[],
)
- f1edit = api.create_file(f1, editgroup_id=eg.editgroup_id)
+ f1edit = api.create_file(eg.editgroup_id, f1)
api.accept_editgroup(eg.editgroup_id)
f2 = api.get_file(f1edit.ident)
@@ -50,7 +50,7 @@ def test_file(api):
# delete
eg = quick_eg(api)
- api.delete_file(f2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_file(eg.editgroup_id, f2.ident)
api.accept_editgroup(eg.editgroup_id)
f2 = api.get_file(f2.ident)
assert f2.state == "deleted"
diff --git a/python/tests/api_filesets.py b/python/tests/api_filesets.py
index 7838d769..4ed3d877 100644
--- a/python/tests/api_filesets.py
+++ b/python/tests/api_filesets.py
@@ -12,7 +12,7 @@ def test_fileset(api):
eg = quick_eg(api)
r1 = ReleaseEntity(title="test fileset release", ext_ids=ReleaseExtIds())
- r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id)
+ r1edit = api.create_release(eg.editgroup_id, r1)
fs1 = FilesetEntity(
manifest = [
@@ -40,7 +40,7 @@ def test_fileset(api):
release_ids = [r1edit.ident],
)
- fs1edit = api.create_fileset(fs1, editgroup_id=eg.editgroup_id)
+ fs1edit = api.create_fileset(eg.editgroup_id, fs1)
api.accept_editgroup(eg.editgroup_id)
fs2 = api.get_fileset(fs1edit.ident)
@@ -63,7 +63,7 @@ def test_fileset(api):
# delete
eg = quick_eg(api)
- api.delete_fileset(fs2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_fileset(eg.editgroup_id, fs2.ident)
api.accept_editgroup(eg.editgroup_id)
fs2 = api.get_fileset(fs2.ident)
assert fs2.state == "deleted"
@@ -90,5 +90,5 @@ def test_bad_fileset(api):
for b in bad_list:
with pytest.raises(fatcat_client.rest.ApiException):
- api.create_fileset(b, editgroup_id=eg.editgroup_id)
+ api.create_fileset(eg.editgroup_id, b)
diff --git a/python/tests/api_misc.py b/python/tests/api_misc.py
index 27d64025..ef26a6c0 100644
--- a/python/tests/api_misc.py
+++ b/python/tests/api_misc.py
@@ -38,5 +38,5 @@ def test_unexpected_body(api):
sha1="88888888888888892dd2657a1e3c992b5dc45dd2",
)
f1.urls = [dict(url="http://thing", rel="repository", asdf="blue")]
- api.create_file(f1, editgroup_id=eg.editgroup_id)
+ api.create_file(eg.editgroup_id, f1)
diff --git a/python/tests/api_releases.py b/python/tests/api_releases.py
index 5965ae4e..9e72eb65 100644
--- a/python/tests/api_releases.py
+++ b/python/tests/api_releases.py
@@ -71,7 +71,7 @@ def test_release(api):
)
r1.bogus = "asdf"
- r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id)
+ r1edit = api.create_release(eg.editgroup_id, r1)
api.accept_editgroup(eg.editgroup_id)
r2 = api.get_release(r1edit.ident)
@@ -131,7 +131,7 @@ def test_release(api):
# delete
eg = quick_eg(api)
- api.delete_release(r2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_release(eg.editgroup_id, r2.ident)
api.accept_editgroup(eg.editgroup_id)
r2 = api.get_release(r2.ident)
assert r2.state == "deleted"
@@ -178,14 +178,14 @@ def test_empty_fields(api):
title="something",
contribs=[ReleaseContrib(raw_name="somebody")],
ext_ids=ReleaseExtIds())
- r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id)
+ r1edit = api.create_release(eg.editgroup_id, r1)
with pytest.raises(fatcat_client.rest.ApiException):
r2 = ReleaseEntity(title="", ext_ids=ReleaseExtIds())
- api.create_release(r2, editgroup_id=eg.editgroup_id)
+ api.create_release(eg.editgroup_id, r2)
with pytest.raises(fatcat_client.rest.ApiException):
r2 = ReleaseEntity(title="something", contribs=[ReleaseContrib(raw_name="")], ext_ids=ReleaseExtIds())
- api.create_release(r2, editgroup_id=eg.editgroup_id)
+ api.create_release(eg.editgroup_id, r2)
def test_controlled_vocab(api):
@@ -193,13 +193,13 @@ def test_controlled_vocab(api):
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)
+ api.create_release(eg.editgroup_id, r1)
r1.release_type = "article"
- api.create_release(r1, editgroup_id=eg.editgroup_id)
+ api.create_release(eg.editgroup_id, r1)
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)
+ api.create_release(eg.editgroup_id, r2)
r2.release_stage = "published"
- api.create_release(r2, editgroup_id=eg.editgroup_id)
+ api.create_release(eg.editgroup_id, r2)
diff --git a/python/tests/api_webcaptures.py b/python/tests/api_webcaptures.py
index 896c9d8a..2b3deb95 100644
--- a/python/tests/api_webcaptures.py
+++ b/python/tests/api_webcaptures.py
@@ -13,7 +13,7 @@ def test_webcapture(api):
eg = quick_eg(api)
r1 = ReleaseEntity(title="test webcapture release", ext_ids=ReleaseExtIds())
- r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id)
+ r1edit = api.create_release(eg.editgroup_id, r1)
wc1 = WebcaptureEntity(
original_url = "http://example.site",
@@ -49,7 +49,7 @@ def test_webcapture(api):
release_ids = [r1edit.ident],
)
- wc1edit = api.create_webcapture(wc1, editgroup_id=eg.editgroup_id)
+ wc1edit = api.create_webcapture(eg.editgroup_id, wc1)
api.accept_editgroup(eg.editgroup_id)
wc2 = api.get_webcapture(wc1edit.ident)
@@ -83,7 +83,7 @@ def test_webcapture(api):
# delete
eg = quick_eg(api)
- api.delete_webcapture(wc2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_webcapture(eg.editgroup_id, wc2.ident)
api.accept_editgroup(eg.editgroup_id)
wc2 = api.get_webcapture(wc2.ident)
assert wc2.state == "deleted"
@@ -144,10 +144,10 @@ def test_bad_webcapture(api):
timestamp="20120102030405")]),
]
- api.create_webcapture(good, editgroup_id=eg.editgroup_id)
+ api.create_webcapture(eg.editgroup_id, good)
for b in bad_list:
with pytest.raises(fatcat_client.rest.ApiException):
- api.create_webcapture(b, editgroup_id=eg.editgroup_id)
+ api.create_webcapture(eg.editgroup_id, b)
with pytest.raises(ValueError):
# missing/empty CDX url
diff --git a/python/tests/citation_efficiency.py b/python/tests/citation_efficiency.py
index e4add80c..b447ca56 100644
--- a/python/tests/citation_efficiency.py
+++ b/python/tests/citation_efficiency.py
@@ -18,7 +18,7 @@ def test_citation_indexing(api):
ReleaseRef(key="second", title="the second title"),
ReleaseRef(key="third", title="a third title"),
]
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
api.accept_editgroup(eg.editgroup_id)
assert r1.refs[0].index == 0
@@ -30,7 +30,7 @@ def test_citation_indexing(api):
r1.refs.pop(1)
eg = quick_eg(api)
- api.update_release(r1.ident, r1, editgroup_id=eg.editgroup_id)
+ api.update_release(eg.editgroup_id, r1.ident, r1)
api.accept_editgroup(eg.editgroup_id)
r1 = api.get_release(r1.ident)
@@ -45,18 +45,18 @@ def test_citation_targets(api):
eg = quick_eg(api)
r1 = ReleaseEntity(title="the target", ext_ids=ReleaseExtIds())
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
r2 = ReleaseEntity(title="the citer", ext_ids=ReleaseExtIds())
r2.refs = [
ReleaseRef(key="first", title="something else"),
ReleaseRef(key="second", title="the target title"),
]
- r2 = api.get_release(api.create_release(r2, editgroup_id=eg.editgroup_id).ident)
+ r2 = api.get_release(api.create_release(eg.editgroup_id, r2).ident)
api.accept_editgroup(eg.editgroup_id)
eg = quick_eg(api)
r2.refs[1].target_release_id = r1.ident
- api.update_release(r2.ident, r2, editgroup_id=eg.editgroup_id)
+ api.update_release(eg.editgroup_id, r2.ident, r2)
api.accept_editgroup(eg.editgroup_id)
r2 = api.get_release(r2.ident)
assert r2.refs[0].key == "first"
@@ -76,8 +76,8 @@ def test_citation_empty_array(api):
r2.refs = []
eg = quick_eg(api)
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
- r2 = api.get_release(api.create_release(r2, editgroup_id=eg.editgroup_id).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
+ r2 = api.get_release(api.create_release(eg.editgroup_id, r2).ident)
api.accept_editgroup(eg.editgroup_id)
print(r1.refs)
@@ -103,7 +103,7 @@ def test_citation_encoding(api):
]
eg = quick_eg(api)
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
api.accept_editgroup(eg.editgroup_id)
assert title == r1.refs[0].title
diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py
index 0a014823..d958b5dc 100644
--- a/python/tests/fixtures.py
+++ b/python/tests/fixtures.py
@@ -57,13 +57,13 @@ def api_dummy_entities(api):
)
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
- j1 = api.get_container(api.create_container(j1, editgroup_id=eg.editgroup_id).ident)
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
+ j1 = api.get_container(api.create_container(eg.editgroup_id, j1).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
w1 = api.get_work(r1.work_id)
- f1 = api.get_file(api.create_file(f1, editgroup_id=eg.editgroup_id).ident)
- fs1 = api.get_fileset(api.create_fileset(fs1, editgroup_id=eg.editgroup_id).ident)
- wc1 = api.get_webcapture(api.create_webcapture(wc1, editgroup_id=eg.editgroup_id).ident)
+ f1 = api.get_file(api.create_file(eg.editgroup_id, f1).ident)
+ fs1 = api.get_fileset(api.create_fileset(eg.editgroup_id, fs1).ident)
+ wc1 = api.get_webcapture(api.create_webcapture(eg.editgroup_id, wc1).ident)
return {
"api": api,
diff --git a/python/tests/subentity_state.py b/python/tests/subentity_state.py
index 2b71e04a..aca0379c 100644
--- a/python/tests/subentity_state.py
+++ b/python/tests/subentity_state.py
@@ -34,20 +34,20 @@ def test_relation_states(api, app):
# WIP container
eg = quick_eg(api)
- j2 = api.get_container(api.create_container(j2, editgroup_id=eg.editgroup_id).ident)
+ j2 = api.get_container(api.create_container(eg.editgroup_id, j2).ident)
rv = app.get('/container/{}'.format(j2.ident))
assert rv.status_code == 200
# create inter-related entities
eg = quick_eg(api)
- j1 = api.get_container(api.create_container(j1, editgroup_id=eg.editgroup_id).ident)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ j1 = api.get_container(api.create_container(eg.editgroup_id, j1).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
r1.container_id = j1.ident
r1.contribs = [ReleaseContrib(creator_id=c1.ident)]
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
- r2 = api.get_release(api.create_release(r2, editgroup_id=eg.editgroup_id).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
+ r2 = api.get_release(api.create_release(eg.editgroup_id, r2).ident)
f1.release_ids = [r1.ident]
- f1 = api.get_file(api.create_file(f1, editgroup_id=eg.editgroup_id).ident)
+ f1 = api.get_file(api.create_file(eg.editgroup_id, f1).ident)
api.accept_editgroup(eg.editgroup_id)
r1 = api.get_release(r1.ident, expand="container,creators,files")
@@ -61,7 +61,7 @@ def test_relation_states(api, app):
# delete creator
eg = quick_eg(api)
- api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
+ api.delete_creator(eg.editgroup_id, c1.ident)
api.accept_editgroup(eg.editgroup_id)
rv = app.get('/creator/{}'.format(c1.ident))
assert rv.status_code == 200 # TODO: HTTP status "Gone"?
@@ -82,7 +82,7 @@ def test_relation_states(api, app):
# wip container
eg = quick_eg(api)
r1.container_id = j2.ident
- api.update_release(r1.ident, r1, editgroup_id=eg.editgroup_id)
+ api.update_release(eg.editgroup_id, r1.ident, r1)
api.accept_editgroup(eg.editgroup_id)
r1 = api.get_release(r1.ident, expand="container,creators,files")
@@ -100,9 +100,9 @@ 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=ReleaseExtIds()), editgroup_id=eg.editgroup_id)
+ api.update_release(eg.editgroup_id, r2.ident, ReleaseEntity(redirect=r1.ident, ext_ids=ReleaseExtIds()))
f2.release_ids = [r2.ident]
- f2 = api.get_file(api.create_file(f2, editgroup_id=eg.editgroup_id).ident)
+ f2 = api.get_file(api.create_file(eg.editgroup_id, f2).ident)
api.accept_editgroup(eg.editgroup_id)
r2 = api.get_release(r2.ident, expand="container,creators,files")
assert r2.container_id == j2.ident
@@ -120,7 +120,7 @@ def test_relation_states(api, app):
# delete release
eg = quick_eg(api)
- api.delete_release(r2.ident, editgroup_id=eg.editgroup_id)
+ api.delete_release(eg.editgroup_id, r2.ident)
api.accept_editgroup(eg.editgroup_id)
r2 = api.get_release(r2.ident, expand="container,creators,files")
assert r2.container_id is None
@@ -147,26 +147,26 @@ def test_app_entity_states(api, app):
# create inter-related entities
eg = quick_eg(api)
- j1 = api.get_container(api.create_container(j1, editgroup_id=eg.editgroup_id).ident)
- j2 = api.get_container(api.create_container(j2, editgroup_id=eg.editgroup_id).ident)
- c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
- c2 = api.get_creator(api.create_creator(c2, editgroup_id=eg.editgroup_id).ident)
+ j1 = api.get_container(api.create_container(eg.editgroup_id, j1).ident)
+ j2 = api.get_container(api.create_container(eg.editgroup_id, j2).ident)
+ c1 = api.get_creator(api.create_creator(eg.editgroup_id, c1).ident)
+ c2 = api.get_creator(api.create_creator(eg.editgroup_id, c2).ident)
r1.container_id = j1.ident
r1.contribs = [ReleaseContrib(creator_id=c1.ident)]
- r1 = api.get_release(api.create_release(r1, editgroup_id=eg.editgroup_id).ident)
- r2 = api.get_release(api.create_release(r2, editgroup_id=eg.editgroup_id).ident)
+ r1 = api.get_release(api.create_release(eg.editgroup_id, r1).ident)
+ r2 = api.get_release(api.create_release(eg.editgroup_id, r2).ident)
f1.release_ids = [r1.ident]
- f1 = api.get_file(api.create_file(f1, editgroup_id=eg.editgroup_id).ident)
- f2 = api.get_file(api.create_file(f2, editgroup_id=eg.editgroup_id).ident)
+ f1 = api.get_file(api.create_file(eg.editgroup_id, f1).ident)
+ f2 = api.get_file(api.create_file(eg.editgroup_id, f2).ident)
api.accept_editgroup(eg.editgroup_id)
# create redirects
eg = quick_eg(api)
- 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=ReleaseExtIds()), editgroup_id=eg.editgroup_id)
- api.update_work(r2.work_id, WorkEntity(redirect=r1.work_id), editgroup_id=eg.editgroup_id)
+ api.update_container(eg.editgroup_id, j2.ident, ContainerEntity(redirect=j1.ident))
+ api.update_creator(eg.editgroup_id, c2.ident, CreatorEntity(redirect=c1.ident))
+ api.update_file(eg.editgroup_id, f2.ident, FileEntity(redirect=f1.ident))
+ api.update_release(eg.editgroup_id, r2.ident, ReleaseEntity(redirect=r1.ident, ext_ids=ReleaseExtIds()))
+ api.update_work(eg.editgroup_id, r2.work_id, WorkEntity(redirect=r1.work_id))
api.accept_editgroup(eg.editgroup_id)
# all entities
@@ -193,11 +193,11 @@ def test_app_entity_states(api, app):
# delete targets
eg = quick_eg(api)
- api.delete_container(j1.ident, editgroup_id=eg.editgroup_id)
- api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
- api.delete_file(f1.ident, editgroup_id=eg.editgroup_id)
- api.delete_release(r1.ident, editgroup_id=eg.editgroup_id)
- api.delete_work(r1.work_id, editgroup_id=eg.editgroup_id)
+ api.delete_container(eg.editgroup_id, j1.ident)
+ api.delete_creator(eg.editgroup_id, c1.ident)
+ api.delete_file(eg.editgroup_id, f1.ident)
+ api.delete_release(eg.editgroup_id, r1.ident)
+ api.delete_work(eg.editgroup_id, r1.work_id)
api.accept_editgroup(eg.editgroup_id)
# all entities