def update_role(self, rolename, roledescription): secClient1 = SecurityClient(base_url, username1, password1) try: secClient1.update_role(rolename, roledescription) except Exception, exception: message = exception #"Role not updated" raise AssertionError(message)
def update_role_and_expect_error(self, rolename, roledescription): secClient1 = SecurityClient(base_url, username1, password1) try: role1 = secClient1.get_role(rolename) role1name = str(role1.name) role1desc = str(role1.description) secClient1.update_role(rolename, roledescription) message = "role updated" raise AssertionError(message) except AssertionError: raise AssertionError(message) except Exception, exception: if role1name != rolename: message = "role name has been updated" raise AssertionError(message) elif role1desc != roledescription: message = "role description has been updated" raise AssertionError(message)