Skip to content

Commit a025dc2

Browse files
committed
test: update user idp
1 parent cad1144 commit a025dc2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_user.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,21 @@ def test_add_user_idp_configuration(self):
251251
user_elem = tree.find(".//user")
252252
assert user_elem is not None
253253
assert user_elem.attrib["idpConfigurationId"] == "012345"
254+
255+
def test_update_user_idp_configuration(self):
256+
with open(ADD_XML) as f:
257+
response_xml = f.read()
258+
user = TSC.UserItem(name="Cassie", site_role="Viewer", auth_setting="ServerDefault")
259+
user._id = "0123456789"
260+
user.idp_configuration_id = "012345"
261+
262+
with requests_mock.mock() as m:
263+
m.put(f"{self.server.users.baseurl}/{user.id}", text=response_xml)
264+
user = self.server.users.update(user)
265+
266+
history = m.request_history[0]
267+
268+
tree = ET.fromstring(history.text)
269+
user_elem = tree.find(".//user")
270+
assert user_elem is not None
271+
assert user_elem.attrib["idpConfigurationId"] == "012345"

0 commit comments

Comments
 (0)