summaryrefslogtreecommitdiffstats
path: root/python/tests/fixtures.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/fixtures.py
parent5d67946807fb9b6878915735b1e0e1938eb7c02a (diff)
downloadfatcat-778e71eb30a44dc6dce51709d2b70ba1559fc98b.tar.gz
fatcat-778e71eb30a44dc6dce51709d2b70ba1559fc98b.zip
trivial tests of edit get/delete
Diffstat (limited to 'python/tests/fixtures.py')
-rw-r--r--python/tests/fixtures.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py
index 478fdd79..9d4caac5 100644
--- a/python/tests/fixtures.py
+++ b/python/tests/fixtures.py
@@ -8,6 +8,7 @@ from dotenv import load_dotenv
import fatcat_web
import fatcat_client
+from fatcat_client import *
from fatcat_tools import authenticated_api
@pytest.fixture
@@ -38,6 +39,44 @@ def api():
api_client.editor_id = "aaaaaaaaaaaabkvkaaaaaaaaae"
return api_client
+@pytest.fixture
+def api_dummy_entities(api):
+ """
+ This is a sort of bleh fixture. Should probably create an actual
+ object/class with create/accept/clean-up methods?
+ """
+
+ c1 = CreatorEntity(display_name="test creator deletion")
+ j1 = ContainerEntity(name="test journal deletion")
+ r1 = ReleaseEntity(title="test release creator deletion")
+ f1 = FileEntity()
+ fs1 = FilesetEntity()
+ wc1 = WebcaptureEntity(
+ timestamp="2000-01-01T12:34:56Z",
+ original_url="http://example.com/",
+ )
+
+ 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)
+ 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)
+
+ return {
+ "api": api,
+ "editgroup": eg,
+ "creator": c1,
+ "container": j1,
+ "file": f1,
+ "fileset": fs1,
+ "webcapture": wc1,
+ "release": r1,
+ "work": w1,
+ }
+
def test_get_changelog_entry(api):
"""Check that fixture is working"""
cl = api.get_changelog_entry(1)