From 778e71eb30a44dc6dce51709d2b70ba1559fc98b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 7 May 2019 17:58:12 -0700 Subject: trivial tests of edit get/delete --- python/tests/fixtures.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'python/tests/fixtures.py') 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) -- cgit v1.2.3