Skip to content

Commit 7cae501

Browse files
committed
don't need this error checking
1 parent 72dbc7a commit 7cae501

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

tests/test_functional.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,25 +247,13 @@ def test_add_users():
247247
"usergroup": "SampleUsers"}
248248

249249

250-
def test_add_users_error():
251-
group = GroupAction(group_name="SampleUsers")
252-
with pytest.raises(ValueError):
253-
group.add_users(users=[])
254-
255-
256250
def test_remove_users():
257251
group = GroupAction(group_name="SampleUsers")
258252
group.remove_users(users=["[email protected]", "[email protected]"])
259253
assert group.wire_dict() == {"do": [{"remove": {"user": ["[email protected]", "[email protected]"]}}],
260254
"usergroup": "SampleUsers"}
261255

262256

263-
def test_remove_users_error():
264-
group = GroupAction(group_name="SampleUsers")
265-
with pytest.raises(ValueError):
266-
group.remove_users(users=[])
267-
268-
269257
def test_create_user_group():
270258
group = GroupAction(group_name="Test Group")
271259
group.create(description="Test Group Description")

umapi_client/functional.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,28 +255,24 @@ def remove_from_products(self, products):
255255
plist = {"productConfiguration": list(products)}
256256
return self.append(remove=plist)
257257

258-
def add_users(self, users=None):
258+
def add_users(self, users):
259259
"""
260260
Add users (specified by email address) to this user group.
261261
In case of ambiguity (two users with same email address), the non-AdobeID user is preferred.
262262
:param users: list of emails for users to add to the group.
263263
:return: the Group, so you can do Group(...).add_users(...).add_to_products(...)
264264
"""
265-
if not users:
266-
raise ArgumentError("You must specify emails for users to add to the user group")
267-
ulist = {"user": [user for user in users]}
265+
ulist = {"user": list(users)}
268266
return self.append(add=ulist)
269267

270-
def remove_users(self, users=None):
268+
def remove_users(self, users):
271269
"""
272270
Remove users (specified by email address) from this user group.
273271
In case of ambiguity (two users with same email address), the non-AdobeID user is preferred.
274272
:param users: list of emails for users to remove from the group.
275273
:return: the Group, so you can do Group(...).remove_users(...).add_to_products(...)
276274
"""
277-
if not users:
278-
raise ArgumentError("You must specify emails for users to remove from the user group")
279-
ulist = {"user": [user for user in users]}
275+
ulist = {"user": list(users)}
280276
return self.append(remove=ulist)
281277

282278
def create(self, option=IfAlreadyExistsOption.ignoreIfAlreadyExists, description=None):

0 commit comments

Comments
 (0)