diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-23 14:35:16 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-23 14:35:16 -0800 |
commit | 1fa8f820fd3b7c64d424f55796d2b860d22e4b22 (patch) | |
tree | 69ad02749989c42daf507c0ee473610ebb3ed5a6 | |
parent | f99b68aca1ac2cdb4c06207fd43310bd1a741cf7 (diff) | |
download | fatcat-1fa8f820fd3b7c64d424f55796d2b860d22e4b22.tar.gz fatcat-1fa8f820fd3b7c64d424f55796d2b860d22e4b22.zip |
specific test for desc/extra in editgroups
-rw-r--r-- | python/tests/api_editgroups.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/python/tests/api_editgroups.py b/python/tests/api_editgroups.py index cff3ffaf..722d8686 100644 --- a/python/tests/api_editgroups.py +++ b/python/tests/api_editgroups.py @@ -111,6 +111,30 @@ def test_editgroup_autoaccept(api): assert eg2.changelog_index #print(edits1) #print(eg1.edits.creators) - assert eg1.edits.creators[0].ident == edits1[0].ident - assert eg2.edits.creators[0].ident == edits2[0].ident + assert eg1.edits.creators[0].ident in [t.ident for t in edits1] + assert eg2.edits.creators[0].ident in [t.ident for t in edits2] + +def test_batch_params(api): + + eg = quick_eg(api) + c1 = CreatorEntity(display_name="test autoaccept") + c2 = CreatorEntity(display_name="test another autoaccept") + + with pytest.raises(fatcat_client.rest.ApiException): + edits = api.create_creator_batch([c1, c2]) + + desc = "test description" + extra = dict(a=75, q="thing") + edits = api.create_creator_batch([c1, c2], autoaccept=True, description=desc, extra=json.dumps(extra)) + eg = api.get_editgroup(edits[0].editgroup_id) + + assert eg.description == desc + assert eg.extra == extra + + # currently must manually json dumps() extra field + with pytest.raises(fatcat_client.rest.ApiException): + api.create_creator_batch([c1, c2], autoaccept=True, description=desc, extra=extra) + + with pytest.raises(fatcat_client.rest.ApiException): + api.create_creator_batch([c1, c2], autoaccept=True, description=desc, extra="{") |