diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-24 15:46:15 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-24 15:46:15 -0800 |
commit | 6b1b131ba5e899a069fe280663d331932a8cbae5 (patch) | |
tree | d0cc85b1ba6e30f8398e88683595eff747240310 | |
parent | f955f66789b0078dcb973ce587d2d3b3184e73a7 (diff) | |
download | fatcat-6b1b131ba5e899a069fe280663d331932a8cbae5.tar.gz fatcat-6b1b131ba5e899a069fe280663d331932a8cbae5.zip |
empty fields test
-rw-r--r-- | python/tests/api_releases.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/python/tests/api_releases.py b/python/tests/api_releases.py index ed6f24a4..247ad2c2 100644 --- a/python/tests/api_releases.py +++ b/python/tests/api_releases.py @@ -101,3 +101,16 @@ def test_release_examples(api): assert r1.contribs[0].role == "editor" assert r1.abstracts[0].mimetype == "application/xml+jats" +def test_empty_fields(api): + + eg = quick_eg(api) + + r1 = ReleaseEntity(title="something", contribs=[ReleaseContrib(raw_name="somebody")]) + r1edit = api.create_release(r1, editgroup_id=eg.editgroup_id) + + with pytest.raises(fatcat_client.rest.ApiException): + r2 = ReleaseEntity(title="") + api.create_release(r2, editgroup_id=eg.editgroup_id) + with pytest.raises(fatcat_client.rest.ApiException): + r2 = ReleaseEntity(title="something", contribs=[ReleaseContrib(raw_name="")]) + api.create_release(r2, editgroup_id=eg.editgroup_id) |