aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/subentity_state.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-08 20:26:07 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-08 20:26:09 -0800
commit8d97683a28bdaa4cf170a78b5094d467f5f018ef (patch)
treef48e9811a63bc48bbd96530c534ad7fb25283386 /python/tests/subentity_state.py
parent4e51c1b8fb78b4806e389263a22adb0a4a6b78bc (diff)
downloadfatcat-8d97683a28bdaa4cf170a78b5094d467f5f018ef.tar.gz
fatcat-8d97683a28bdaa4cf170a78b5094d467f5f018ef.zip
partially revert raise_for_status() refactor
Doesn't work with Flask wrapper, of course.
Diffstat (limited to 'python/tests/subentity_state.py')
-rw-r--r--python/tests/subentity_state.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/python/tests/subentity_state.py b/python/tests/subentity_state.py
index 799f5e03..03362686 100644
--- a/python/tests/subentity_state.py
+++ b/python/tests/subentity_state.py
@@ -36,7 +36,7 @@ def test_relation_states(api, app):
eg = quick_eg(api)
j2 = api.get_container(api.create_container(j2, editgroup_id=eg.editgroup_id).ident)
rv = app.get('/container/{}'.format(j2.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
# create inter-related entities
eg = quick_eg(api)
@@ -57,15 +57,14 @@ def test_relation_states(api, app):
assert r1.contribs[0].creator.display_name == "test person"
assert r1.contribs[0].creator.state == "active"
rv = app.get('/release/{}'.format(r1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
# delete creator
eg = quick_eg(api)
api.delete_creator(c1.ident, editgroup_id=eg.editgroup_id)
api.accept_editgroup(eg.editgroup_id)
rv = app.get('/creator/{}'.format(c1.ident))
- # TODO: HTTP status "Gone"?
- rv.raise_for_status()
+ assert rv.status_code == 200 # TODO: HTTP status "Gone"?
c1_deleted = api.get_creator(c1.ident)
assert c1_deleted.state == "deleted"
@@ -78,7 +77,7 @@ def test_relation_states(api, app):
assert r1.contribs[0].creator.display_name is None
assert r1.contribs[0].creator.state == "deleted"
rv = app.get('/release/{}'.format(r1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
# wip container
eg = quick_eg(api)
@@ -95,7 +94,7 @@ def test_relation_states(api, app):
assert r1.contribs[0].creator.display_name is None
assert r1.contribs[0].creator.state == "deleted"
rv = app.get('/release/{}'.format(r1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
# redirect release
r2 = api.get_release(r2.ident, expand="container,creators,files")
@@ -117,7 +116,7 @@ def test_relation_states(api, app):
rv = app.get('/release/{}'.format(r2.ident))
assert rv.status_code == 302
rv = app.get('/file/{}'.format(f2.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
# delete release
eg = quick_eg(api)
@@ -129,11 +128,10 @@ def test_relation_states(api, app):
assert r2.files is None
assert r2.contribs is None
rv = app.get('/release/{}'.format(r2.ident))
- # TODO: HTTP Gone?
- rv.raise_for_status()
+ assert rv.status_code == 200 # TODO: HTTP Gone?
rv = app.get('/file/{}'.format(f2.ident))
print(rv.data)
- rv.raise_for_status()
+ assert rv.status_code == 200
def test_app_entity_states(api, app):
@@ -173,23 +171,23 @@ def test_app_entity_states(api, app):
# all entities
rv = app.get('/container/{}'.format(j1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/container/{}'.format(j2.ident))
assert rv.status_code == 302
rv = app.get('/creator/{}'.format(c1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/creator/{}'.format(c2.ident))
assert rv.status_code == 302
rv = app.get('/file/{}'.format(f1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/file/{}'.format(f2.ident))
assert rv.status_code == 302
rv = app.get('/release/{}'.format(r1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/release/{}'.format(r2.ident))
assert rv.status_code == 302
rv = app.get('/work/{}'.format(r1.work_id))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/work/{}'.format(r2.work_id))
assert rv.status_code == 302
@@ -204,23 +202,23 @@ def test_app_entity_states(api, app):
# all entities
rv = app.get('/container/{}'.format(j1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/container/{}'.format(j2.ident))
assert rv.status_code == 302
rv = app.get('/creator/{}'.format(c1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/creator/{}'.format(c2.ident))
assert rv.status_code == 302
rv = app.get('/file/{}'.format(f1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/file/{}'.format(f2.ident))
assert rv.status_code == 302
rv = app.get('/release/{}'.format(r1.ident))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/release/{}'.format(r2.ident))
assert rv.status_code == 302
rv = app.get('/work/{}'.format(r1.work_id))
- rv.raise_for_status()
+ assert rv.status_code == 200
rv = app.get('/work/{}'.format(r2.work_id))
assert rv.status_code == 302