diff options
| author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-21 00:15:00 -0800 | 
|---|---|---|
| committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-21 00:15:00 -0800 | 
| commit | fd44835325cdef6c8faddcf272b309d1c995d486 (patch) | |
| tree | 1169a9b56b4444b9d3c02469c0958b7a99b348f9 | |
| parent | ca1ec8d9a722dd08f04c21981691d4c060f90a51 (diff) | |
| download | fatcat-fd44835325cdef6c8faddcf272b309d1c995d486.tar.gz fatcat-fd44835325cdef6c8faddcf272b309d1c995d486.zip | |
more redirect/state tests
| -rw-r--r-- | python/tests/api_entity_redirects.py | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/python/tests/api_entity_redirects.py b/python/tests/api_entity_redirects.py index 9bcd255c..208688e9 100644 --- a/python/tests/api_entity_redirects.py +++ b/python/tests/api_entity_redirects.py @@ -151,6 +151,9 @@ def test_delete_entity(api):      # delete      eg = quick_eg(api)      api.delete_creator(c1.ident, editgroup=eg.id) +    with pytest.raises(fatcat_client.rest.ApiException): +        # can't re-delete in same editgroup +        api.delete_creator(c1.ident, editgroup=eg.id)      api.accept_editgroup(eg.id)      res = api.get_creator(c1.ident)      assert res.state == "deleted" @@ -158,6 +161,18 @@ def test_delete_entity(api):      with pytest.raises(fatcat_client.rest.ApiException):          res = api.lookup_creator(orcid=c1.orcid) +    # re-delete +    eg = quick_eg(api) +    try: +        # can't re-delete an entity +        api.delete_creator(c1.ident, editgroup=eg.id) +        #api.accept_editgroup(eg.id) +        assert False +    except fatcat_client.rest.ApiException as e: +        # error is 4xx +        print(e) +        assert 400 <= e.status < 500 +      # undelete      eg = quick_eg(api)      api.update_creator(c1.ident, c1, editgroup=eg.id) | 
