Skip to content

Commit 72dbc7a

Browse files
committed
UMAPI never supported this
1 parent eea2300 commit 72dbc7a

File tree

2 files changed

+4
-45
lines changed

2 files changed

+4
-45
lines changed

tests/test_functional.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,6 @@ def test_add_to_products():
232232
assert group.wire_dict() == {"do": [{"add": {"productConfiguration": ["Photoshop", "Illustrator"]}}],
233233
"usergroup": "SampleUsers"}
234234

235-
def test_add_to_products_all():
236-
group = GroupAction(group_name="SampleUsers")
237-
group.add_to_products(all_products=True)
238-
assert group.wire_dict() == {"do": [{"add": "all"}],
239-
"usergroup": "SampleUsers"}
240-
241-
242-
def test_add_to_products_all_error():
243-
group = GroupAction(group_name="SampleUsers")
244-
with pytest.raises(ValueError):
245-
group.add_to_products(all_products=True, products=["Photoshop"])
246-
247235

248236
def test_remove_from_products():
249237
group = GroupAction(group_name="SampleUsers")
@@ -252,19 +240,6 @@ def test_remove_from_products():
252240
"usergroup": "SampleUsers"}
253241

254242

255-
def test_remove_from_products_all():
256-
group = GroupAction(group_name="SampleUsers")
257-
group.remove_from_products(all_products=True)
258-
assert group.wire_dict() == {"do": [{"remove": "all"}],
259-
"usergroup": "SampleUsers"}
260-
261-
262-
def test_remove_from_products_all_error():
263-
group = GroupAction(group_name="SampleUsers")
264-
with pytest.raises(ValueError):
265-
group.remove_from_products(all_products=True, products=["Photoshop"])
266-
267-
268243
def test_add_users():
269244
group = GroupAction(group_name="SampleUsers")
270245
group.add_users(users=["[email protected]", "[email protected]"])

umapi_client/functional.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -237,38 +237,22 @@ def __init__(self, group_name=None, **kwargs):
237237
ArgumentError("You must provide the name of the group")
238238
Action.__init__(self, usergroup=group_name, **kwargs)
239239

240-
def add_to_products(self, products=None, all_products=False):
240+
def add_to_products(self, products):
241241
"""
242242
Add user group to some product license configuration groups (PLCs), or all of them.
243243
:param products: list of product names the user should be added to
244-
:param all_products: a boolean meaning add to all (don't specify products in this case)
245244
:return: the Group, so you can do Group(...).add_to_products(...).add_users(...)
246245
"""
247-
if all_products:
248-
if products:
249-
raise ArgumentError("When adding to all products, do not specify specific products")
250-
plist = "all"
251-
else:
252-
if not products:
253-
raise ArgumentError("You must specify products to which to add the user group")
254-
plist = {"productConfiguration": [product for product in products]}
246+
plist = {"productConfiguration": list(products)}
255247
return self.append(add=plist)
256248

257-
def remove_from_products(self, products=None, all_products=False):
249+
def remove_from_products(self, products):
258250
"""
259251
Remove user group from some product license configuration groups (PLCs), or all of them.
260252
:param products: list of product names the user group should be removed from
261-
:param all_products: a boolean meaning remove from all (don't specify products in this case)
262253
:return: the Group, so you can do Group(...).remove_from_products(...).add_users(...)
263254
"""
264-
if all_products:
265-
if products:
266-
raise ArgumentError("When removing from all products, do not specify specific products")
267-
plist = "all"
268-
else:
269-
if not products:
270-
raise ArgumentError("You must specify products from which to remove the user group")
271-
plist = {"productConfiguration": [product for product in products]}
255+
plist = {"productConfiguration": list(products)}
272256
return self.append(remove=plist)
273257

274258
def add_users(self, users=None):

0 commit comments

Comments
 (0)