aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/api_entity_editing.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-07 17:58:12 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-07 17:58:12 -0700
commit778e71eb30a44dc6dce51709d2b70ba1559fc98b (patch)
treee0c21744154b6a95037420399f9d080840992061 /python/tests/api_entity_editing.py
parent5d67946807fb9b6878915735b1e0e1938eb7c02a (diff)
downloadfatcat-778e71eb30a44dc6dce51709d2b70ba1559fc98b.tar.gz
fatcat-778e71eb30a44dc6dce51709d2b70ba1559fc98b.zip
trivial tests of edit get/delete
Diffstat (limited to 'python/tests/api_entity_editing.py')
-rw-r--r--python/tests/api_entity_editing.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/python/tests/api_entity_editing.py b/python/tests/api_entity_editing.py
index bb45b280..eff0ca30 100644
--- a/python/tests/api_entity_editing.py
+++ b/python/tests/api_entity_editing.py
@@ -142,3 +142,42 @@ def test_wip_revision(api):
assert rev.ident is None
assert rev.revision == c1.revision
+
+def test_edit_get_all(api_dummy_entities):
+
+ ade = api_dummy_entities
+ api = ade['api']
+ eg = api.get_editgroup(ade['editgroup'].editgroup_id)
+
+ assert api.get_creator_edit(eg.edits.creators[0].edit_id)
+ assert api.get_container_edit(eg.edits.containers[0].edit_id)
+ assert api.get_file_edit(eg.edits.files[0].edit_id)
+ assert api.get_fileset_edit(eg.edits.filesets[0].edit_id)
+ assert api.get_webcapture_edit(eg.edits.webcaptures[0].edit_id)
+ assert api.get_release_edit(eg.edits.releases[0].edit_id)
+ assert api.get_work_edit(eg.edits.works[0].edit_id)
+
+def test_edit_delete_all(api_dummy_entities):
+
+ ade = 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)
+
+ # verify deletion
+ eg = api.get_editgroup(ade['editgroup'].editgroup_id)
+ assert len(eg.edits.creators) == 0
+ assert len(eg.edits.containers) == 0
+ assert len(eg.edits.files) == 0
+ assert len(eg.edits.filesets) == 0
+ assert len(eg.edits.webcaptures) == 0
+ assert len(eg.edits.releases) == 0
+ assert len(eg.edits.works) == 0
+