Skip to content

Commit 0fd3909

Browse files
committed
test: update user idp
1 parent 650de86 commit 0fd3909

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
@@ -267,3 +267,21 @@ def test_add_user_idp_configuration(self):
267267
user_elem = tree.find(".//user")
268268
assert user_elem is not None
269269
assert user_elem.attrib["idpConfigurationId"] == "012345"
270+
271+
def test_update_user_idp_configuration(self):
272+
with open(ADD_XML) as f:
273+
response_xml = f.read()
274+
user = TSC.UserItem(name="Cassie", site_role="Viewer", auth_setting="ServerDefault")
275+
user._id = "0123456789"
276+
user.idp_configuration_id = "012345"
277+
278+
with requests_mock.mock() as m:
279+
m.put(f"{self.server.users.baseurl}/{user.id}", text=response_xml)
280+
user = self.server.users.update(user)
281+
282+
history = m.request_history[0]
283+
284+
tree = ET.fromstring(history.text)
285+
user_elem = tree.find(".//user")
286+
assert user_elem is not None
287+
assert user_elem.attrib["idpConfigurationId"] == "012345"

0 commit comments

Comments
 (0)