aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-23 14:35:16 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-23 14:35:16 -0800
commit1fa8f820fd3b7c64d424f55796d2b860d22e4b22 (patch)
tree69ad02749989c42daf507c0ee473610ebb3ed5a6 /python/tests
parentf99b68aca1ac2cdb4c06207fd43310bd1a741cf7 (diff)
downloadfatcat-1fa8f820fd3b7c64d424f55796d2b860d22e4b22.tar.gz
fatcat-1fa8f820fd3b7c64d424f55796d2b860d22e4b22.zip
specific test for desc/extra in editgroups
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/api_editgroups.py28
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="{")