How to use __get_result method in yandex-tank

Best Python code snippet using yandex-tank

interpreter.py

Source:interpreter.py Github

copy

Full Screen

...22 program.accept(self)23 else:24 print("Parsed data are empty. No program to interpret.")25 if returnResult:26 return self.__get_result()27 def evaluate_program(self, element: Program):28 self.__build_global_context(element)29 mainFunction = self.__get_local_context().functions['main']30 try:31 mainFunction.accept(self)32 if EVAL_RETURN_EXP in self.__get_local_context().specials:33 if self.__get_local_context(34 ).specials[EVAL_RETURN_EXP] is not None:35 result = self.__get_result()36 self.__check_type(mainFunction.returnType, result)37 print(f"Program finished with result: {result}")38 self.__add_result(result)39 self.__pop_context()40 except InterpreterError as error:41 raise InterpreterRuntimeError(error.message, "main")42 def evaluate_function_definition(self, element: FunctionDef):43 try:44 element.statement.accept(self)45 except InterpreterError as error:46 raise InterpreterRuntimeError(error.message, element.identifier)47 def evaluate_function_call(self, element: FunctionCall):48 if element.identifier in self.__get_global_context().functions:49 function = self.__get_global_context().functions[50 element.identifier]51 self.__build_new_context(function, element)52 if element.identifier in std.functions:53 argumentsList = []54 for parameter in function.parameters:55 argumentsList.append(self.__get_local_context().variables[56 parameter.identifier].value)57 if (result := std.functions[element.identifier](argumentsList)58 ) is not None:59 self.__results.append(result)60 else:61 function.accept(self)62 self.__return = False63 self.__pop_context()64 else:65 raise InterpreterError(66 f"Function {element.identifier} is undefined.", str(element))67 def evaluate_statement_block(self, element: StatementBlock):68 for statement in element.statements:69 statement.accept(self)70 if self.__return:71 return72 def evaluate_return_statement(self, element: ReturnStatement):73 try:74 if EVAL_RETURN_EXP in self.__get_local_context().specials:75 self.__evaluate_expression(element.expression)76 # Gets function info from current context and77 # checks if actual expression type matches declared return type.78 # If not, exception is thrown.79 if self.__get_local_context(80 ).specials[EVAL_RETURN_EXP] is not None:81 self.__check_type(82 self.__get_local_context().specials[EVAL_RETURN_EXP],83 self.__peek_result())84 self.__return = True85 except InterpreterError as error:86 raise InterpreterError(error.message, str(element))87 def evaluate_assigne_statement(self, element: AssignStatement):88 key = element.identifier.identifier89 context = self.__get_local_context()90 if key not in context.variables:91 context = self.__get_global_context()92 if key not in context.variables:93 raise InterpreterError(f"Variable {key} was not defined",94 str(element))95 self.__evaluate_expression(element.expression)96 value = self.__get_result()97 variableInfo = context.variables[key]98 #check if proper type is being assigne99 try:100 self.__check_type(variableInfo.type, value)101 except InterpreterError as error:102 raise InterpreterError(error.message, str(element))103 context.variables[key] = VariableInfo(variableInfo.type, value)104 def evaluate_define_statement(self, element: DefineStatement):105 key = element.identifier106 if (key in self.__get_local_context().variables) or (107 key in self.__get_global_context().variables):108 raise InterpreterError(f"Variable redefinition: {key}.",109 str(element))110 if element.expression is None:111 value = self.__defaultValue(element.type)112 else:113 self.__evaluate_expression(element.expression)114 value = self.__get_result()115 #check if types match116 try:117 self.__check_type(element.type, value)118 except InterpreterError as error:119 raise InterpreterError(error.message, str(element))120 self.__contextList[-1].variables[key] = VariableInfo(121 element.type, value)122 def evaluate_if_statement(self, element: IfStatement):123 if isinstance(element.condition, INode):124 element.condition.accept(self)125 value = self.__get_result()126 else:127 value = element.condition128 if bool(value):129 if isinstance(element.statement, INode):130 element.statement.accept(self)131 elif element.elseStatement is not None:132 if isinstance(element.elseStatement, INode):133 element.elseStatement.accept(self)134 def evaluate_while_statement(self, element: WhileStatement):135 while True:136 if isinstance(element.condition, INode):137 element.condition.accept(self)138 value = self.__get_result()139 else:140 value = element.condition141 if bool(value):142 if isinstance(element.statement, INode):143 element.statement.accept(self)144 else:145 return146 def evaluate_expression(self, element: Expression):147 try:148 if isinstance(element.leftExpression, INode):149 element.leftExpression.accept(self)150 leftValue = self.__get_result()151 else:152 leftValue = element.leftExpression153 if isinstance(element.rightExpression, INode):154 element.rightExpression.accept(self)155 rightValue = self.__get_result()156 else:157 rightValue = element.rightExpression158 self.__check_operands_type(leftValue, rightValue)159 except InterpreterError as error:160 raise InterpreterError(error.message, str(element))161 try:162 if element.operator == '+':163 self.__results.append(leftValue + rightValue)164 else:165 self.__results.append(leftValue - rightValue)166 except TypeError as error:167 raise InterpreterError(168 f"Unsupported operand type(s) for operator: {element.operator}",169 str(element))170 def evaluate_subsexpression(self, element: SubExpression):171 try:172 if isinstance(element.leftFactor, INode):173 element.leftFactor.accept(self)174 leftValue = self.__get_result()175 else:176 leftValue = element.leftFactor177 if isinstance(element.rightFactor, INode):178 element.rightFactor.accept(self)179 rightValue = self.__get_result()180 else:181 rightValue = element.rightFactor182 except InterpreterError as error:183 raise InterpreterError(error.message, str(element))184 if (type(leftValue).__name__ == 'str'):185 raise InterpreterError(186 f"Invalid operation: {element.operator}, on string value: {leftValue}"187 )188 elif (type(rightValue).__name__ == 'str'):189 raise InterpreterError(190 f"Invalid operation: {element.operator}, on string value: {rightValue}"191 )192 if rightValue is None:193 result = leftValue194 else:195 try:196 self.__check_operands_type(leftValue, rightValue)197 except InterpreterError as error:198 raise InterpreterError(error.message, str(element))199 if element.operator == '*':200 result = leftValue * rightValue201 else:202 result = leftValue / rightValue203 #because Python automaticly converts to float if int/int is fractions204 if isinstance(leftValue, int):205 result = math.floor(result)206 if element.isNegated:207 result = result * -1208 self.__results.append(result)209 def evaluate_parentheses_expression(self, element: ParenthesesExpression):210 element.expression.accept(self)211 def evaluate_condition(self, element: Condition):212 if isinstance(element.leftCondition, INode):213 element.leftCondition.accept(self)214 leftValue = self.__get_result()215 else:216 leftValue = element.leftCondition217 if isinstance(element.rightCondition, INode):218 element.rightCondition.accept(self)219 rightValue = self.__get_result()220 elif element.rightCondition is not None:221 rightValue = element.rightCondition222 if element.operator == '&&':223 self.__results.append(bool(leftValue and rightValue))224 elif element.operator == '||':225 self.__results.append(bool(leftValue or rightValue))226 elif element.operator == '<':227 self.__results.append(bool(leftValue < rightValue))228 elif element.operator == '<=':229 self.__results.append(bool(leftValue <= rightValue))230 elif element.operator == '>=':231 self.__results.append(bool(leftValue >= rightValue))232 elif element.operator == '>':233 self.__results.append(bool(leftValue > rightValue))234 elif element.operator == '==':235 self.__results.append(bool(leftValue == rightValue))236 elif element.operator == '!=':237 self.__results.append(bool(leftValue != rightValue))238 else:239 raise InterpreterError(240 f"Invalid operator: {element.operator}. Probably caused by error in parser implementation."241 )242 def evaluate_subcondition(self, element: SubCondition):243 if isinstance(element.value, INode):244 element.value.accept(self)245 value = self.__get_result()246 else:247 value = element.value248 if element.isNegated:249 self.__results.append(not bool(value))250 else:251 self.__results.append(value)252 def evaluate_parentheses_condition(self, element: ParenthesesCondition):253 if isinstance(element.value, INode):254 element.value.accept(self)255 value = self.__get_result()256 else:257 value = element.value258 self.__results.append(bool(value))259 def evaluate_variable(self, element: Variable) -> None:260 key = element.identifier261 if key in self.__get_local_context().variables:262 value = self.__get_local_context().variables[key].value263 elif key in self.__get_global_context().variables:264 value = self.__get_global_context().variables[key].value265 else:266 raise InterpreterError(message=f"Undefined variable: {key}.")267 self.__results.append(value)268 def __build_global_context(self, program: Program) -> None:269 declarationDict = {}270 specialsDict = {}271 for declaration in program.defineStatementList:272 key = declaration.identifier273 if key in declarationDict:274 raise InterpreterError(275 f"Multiple definitions of the variable {key}.",276 f"{declaration.type} {declaration.identifier} = {declaration.expression}"277 )278 else:279 declarationDict[key] = VariableInfo(declaration.type,280 declaration.expression)281 functionDefDict = self.__import_stdlib()282 for functionDef in program.functionDefList:283 key = functionDef.identifier284 if key in functionDefDict:285 raise InterpreterError(286 f"Multiple definitions of the function {key}.")287 else:288 functionDefDict[key] = functionDef289 try:290 specialsDict[EVAL_RETURN_EXP] = functionDefDict["main"].returnType291 except KeyError:292 raise InterpreterError("Not found 'main' function.")293 self.__contextList.append(294 Context(variables=declarationDict,295 functions=functionDefDict,296 specials=specialsDict))297 def __build_new_context(self, function: FunctionDef,298 element: FunctionCall):299 #check number of call arguments300 if len(function.parameters) != len(element.arguments):301 raise InterpreterError(302 f"Expected {len(function.parameters)} arguments, {len(element.arguments)} was provided.",303 str(element))304 try:305 variablesDict = {}306 specialsDict = {}307 #function params to context308 for i in range(len(function.parameters)):309 variable = function.parameters[i]310 argument = element.arguments[i]311 if isinstance(element.arguments[i], INode):312 argument.accept(self)313 value = self.__get_result()314 else:315 value = argument316 #check if argument type match declared type in function definition317 self.__check_type(variable.type, value)318 variablesDict[variable.identifier] = VariableInfo(319 variable.type, value)320 except InterpreterError as error:321 raise InterpreterError(error.message, str(element))322 specialsDict[EVAL_RETURN_EXP] = function.returnType323 self.__contextList.append(324 Context(variables=variablesDict,325 functions={},326 specials=specialsDict))327 def __get_local_context(self) -> Context:328 return self.__contextList[-1]329 def __get_global_context(self) -> Context:330 return self.__contextList[0]331 def __pop_context(self) -> None:332 self.__contextList.pop()333 def __check_type(self, expectedType: str, value):334 valueType = type(value).__name__335 if expectedType == 'string' and valueType == 'str':336 return337 elif expectedType == 'frc' and valueType == 'Fraction':338 return339 #int and float case340 elif valueType == expectedType:341 return342 raise InterpreterError(343 f"Type mismatch. Expected type: {expectedType}, provided type: {valueType}"344 )345 def __check_operands_type(self, leftOperand, rightOperand):346 if not type(leftOperand).__name__ == type(rightOperand).__name__:347 raise InterpreterError(348 f"Invalid operands types. Got: {type(leftOperand).__name__} and {type(rightOperand).__name__}"349 )350 def __add_result(self, result) -> None:351 self.__results.append(result)352 def __get_result(self):353 if not self.__results:354 raise InterpreterError("Expected return value.")355 return self.__results.pop()356 def __peek_result(self):357 return self.__results[-1]358 def __evaluate_expression(self, expression):359 if isinstance(expression, INode):360 expression.accept(self)361 else:362 self.__results.append(expression)363 def __defaultValue(self, type: str):364 if type == 'int': return 0365 elif type == 'float': return 0.0366 elif type == 'frc': return std.functions['frc'](1, 1)...

Full Screen

Full Screen

cognito_client.py

Source:cognito_client.py Github

copy

Full Screen

...18 return boto3.Session(19 aws_access_key_id = self.aws_access_key_id,20 aws_secret_access_key = self.aws_secret_access_key,21 region_name = self.pool_region).client('cognito-idp')22 def __get_result(self, response):23 return True if response["ResponseMetadata"]["HTTPStatusCode"] == 200 else False24 def __dict_to_cognito(self, attributes, attr_map=None):25 if attr_map is None:26 attr_map = {}27 for k,v in attr_map.items():28 if v in attributes.keys():29 attributes[k] = attributes.pop(v)30 return [{'Name': key, 'Value': value} for key, value in attributes.items()]31 def __cognito_to_dict(self, attr_list, attr_map=None):32 if attr_map is None:33 attr_map = {}34 attr_dict = dict()35 for a in attr_list:36 name = a.get('Name')37 value = a.get('Value')38 if value in ['true', 'false']:39 value = ast.literal_eval(value.capitalize())40 name = attr_map.get(name,name)41 attr_dict[name] = value42 return attr_dict43 def __get_userpool_keys(self):44 import urllib.request45 import json46 keys_iss = 'https://cognito-idp.{}.amazonaws.com/{}'.format(config.CONFIG_USER_POOL_REGION, config.CONFIG_USER_POOL_ID)47 keys_url = '{}/.well-known/jwks.json'.format(keys_iss)48 response = urllib.request.urlopen(keys_url)49 keys = json.loads(response.read())['keys']50 return keys, keys_iss51 def sign_up(self, username, password, **attributes):52 params = {53 'ClientId' : self.client_id,54 'Username' : username,55 'Password' : password,56 'UserAttributes' : self.__dict_to_cognito(attributes)57 }58 try:59 response = self.__get_client().sign_up(**params)60 except:61 return (False, None)62 return (self.__get_result(response), response)63 def confirm_sign_up(self, username, confirmation_code):64 params = {65 'ClientId' : self.client_id,66 'Username' : username,67 'ConfirmationCode': confirmation_code68 }69 try:70 response = self.__get_client().confirm_sign_up(**params)71 except:72 return (False, None)73 return (self.__get_result(response), response)74 def resend_confirmation_code(self, username):75 params = {76 'ClientId' : self.client_id,77 'Username' : username78 }79 try:80 response = self.__get_client().resend_confirmation_code(**params)81 except:82 return (False, None)83 return (self.__get_result(response), response)84 def forgot_password(self, username):85 params = {86 'ClientId': self.client_id,87 'Username': username88 }89 try:90 response = self.__get_client().forgot_password(**params)91 except:92 return (False, None)93 return (self.__get_result(response), response)94 def confirm_forgot_password(self, username, confirmation_code, new_password):95 params = {96 'ClientId' : self.client_id,97 'Username' : username,98 'ConfirmationCode': confirmation_code,99 'Password' : new_password100 }101 try:102 response = self.__get_client().confirm_forgot_password(**params)103 except:104 return (False, None)105 return (self.__get_result(response), response)106 def login(self, username, password):107 if True:108 params = {109 'AuthFlow' : 'USER_PASSWORD_AUTH',110 'AuthParameters' : {111 'USERNAME': username,112 'PASSWORD': password,113 },114 'ClientId' : self.client_id115 }116 try:117 #start_time = time.time()118 response = self.__get_client().initiate_auth(**params)119 #print(time.time()-start_time)120 except Exception as e:121 print(e)122 return (False, None)123 return (self.__get_result(response), response)124 else:125 client = self.__get_client()126 params = {127 'username' : username,128 'password' : password,129 'pool_id' : self.pool_id,130 'client_id' : self.client_id,131 'client' : client132 }133 try:134 #start_time = time.time()135 aws = AWSSRP(**params)136 response = aws.authenticate_user()137 #print(time.time()-start_time)138 except:139 return (False, None)140 return (self.__get_result(response), response)141 def logout(self, access_token):142 params = {143 'AccessToken': access_token144 }145 try:146 response = self.__get_client().global_sign_out(**params)147 except:148 return (False, None)149 return (self.__get_result(response), response)150 def get_user(self, access_token):151 params = {152 'AccessToken': access_token153 }154 try:155 response = self.__get_client().get_user(**params)156 user_attributes = self.__cognito_to_dict(response["UserAttributes"])157 if 'sub' in user_attributes:158 user_attributes.pop("sub")159 #if 'email_verified' in user_attributes:160 # user_attributes.pop("email_verified")161 #if 'phone_number_verified' in user_attributes:162 # user_attributes.pop("phone_number_verified")163 except:164 return (False, None)165 return (self.__get_result(response), user_attributes)166 def delete_user(self, username, access_token):167 params = {168 'UserPoolId' : self.pool_id,169 'Username' : username,170 #'AccessToken': access_token171 }172 try:173 response = self.__get_client().admin_delete_user(**params)174 #response = self.__get_client().delete_user(**params)175 except:176 return (False, None)177 return (self.__get_result(response), response)178 def admin_delete_user(self, username):179 params = {180 'UserPoolId' : self.pool_id,181 'Username' : username,182 }183 try:184 response = self.__get_client().admin_delete_user(**params)185 except:186 return (False, None)187 return (self.__get_result(response), response)188 def update_user(self, access_token, **attributes):189 params = {190 'AccessToken' : access_token,191 'UserAttributes' : self.__dict_to_cognito(attributes)192 }193 try:194 response = self.__get_client().update_user_attributes(**params)195 except:196 return (False, None)197 return (self.__get_result(response), response)198 199 def change_password(self, access_token, password, new_password):200 params = {201 'PreviousPassword': password,202 'ProposedPassword': new_password,203 'AccessToken' : access_token204 }205 try:206 response = self.__get_client().change_password(**params)207 except:208 return (False, None)209 return (self.__get_result(response), response)210 def request_verify_phone_number(self, access_token):211 params = {212 'AccessToken': access_token,213 'AttributeName': 'phone_number'214 }215 try:216 print("get_user_attribute_verification_code")217 response = self.__get_client().get_user_attribute_verification_code(**params)218 print(response)219 except Exception as e:220 print(e)221 return (False, None)222 return (self.__get_result(response), response)223 def confirm_verify_phone_number(self, access_token, confirmation_code):224 params = {225 'AccessToken': access_token,226 'AttributeName': 'phone_number',227 'Code': confirmation_code228 }229 try:230 response = self.__get_client().verify_user_attribute(**params)231 except:232 return (False, None)233 return (self.__get_result(response), response)234 def admin_refresh_token(self, refresh_token):235 params = {236 'UserPoolId' : self.pool_id,237 'ClientId' : self.client_id,238 'AuthFlow' : 'REFRESH_TOKEN',239 'AuthParameters' : {240 'REFRESH_TOKEN': refresh_token241 },242 }243 try:244 response = self.__get_client().admin_initiate_auth(**params)245 except Exception as e:246 print(e)247 return (False, None)248 return (self.__get_result(response), response)249 def refresh_token(self, refresh_token):250 params = {251 'AuthFlow' : 'REFRESH_TOKEN',252 'AuthParameters' : {253 'REFRESH_TOKEN': refresh_token254 },255 'ClientId' : self.client_id256 }257 try:258 response = self.__get_client().initiate_auth(**params)259 except Exception as e:260 print(e)261 return (False, None)262 return (self.__get_result(response), response)263 def get_username_from_token(self, token):264 if self.keys is None:265 (self.keys, self.keys_iss) = self.__get_userpool_keys()266 try:267 headers = jwt.get_unverified_header(token)268 except:269 return None270 if not headers.get('kid'):271 return None272 kid = headers['kid']273 key_index = -1274 for i in range(len(self.keys)):275 if kid == self.keys[i]['kid']:276 key_index = i277 break278 if key_index == -1:279 return None280 public_key = jwk.construct(self.keys[key_index])281 message, encoded_signature = str(token).rsplit('.', 1)282 decoded_signature = base64url_decode(encoded_signature.encode('utf-8'))283 if not public_key.verify(message.encode("utf8"), decoded_signature):284 return None285 claims = jwt.get_unverified_claims(token)286 return claims["username"]287 def verify_token(self, token, username):288 if self.keys is None:289 (self.keys, self.keys_iss) = self.__get_userpool_keys()290 # get the kid from the headers prior to verification291 try:292 headers = jwt.get_unverified_header(token)293 except:294 return 6295 if not headers.get('kid'):296 return 7297 kid = headers['kid']298 # search for the kid in the downloaded public keys299 key_index = -1300 for i in range(len(self.keys)):301 if kid == self.keys[i]['kid']:302 key_index = i303 break304 if key_index == -1:305 print('Public key not found in jwks.json')306 return 8307 # construct the public key308 public_key = jwk.construct(self.keys[key_index])309 # get the last two sections of the token,310 # message and signature (encoded in base64)311 message, encoded_signature = str(token).rsplit('.', 1)312 # decode the signature313 decoded_signature = base64url_decode(encoded_signature.encode('utf-8'))314 # verify the signature315 if not public_key.verify(message.encode("utf8"), decoded_signature):316 print('Signature verification failed')317 return 9318 # since we passed the verification, we can now safely319 # use the unverified claims320 claims = jwt.get_unverified_claims(token)321 if claims["token_use"] != "access":322 print('Token is not an access token')323 return 1324 curr_time = int(time.time())325 if curr_time > claims["exp"] or curr_time < claims["iat"]:326 #print('Token is expired {} [iat {}, exp {}]'.format(curr_time, claims["iat"], claims["exp"]))327 return 2328 if claims["client_id"] != config.CONFIG_CLIENT_ID:329 print('Token was not issued for this client_id')330 return 3331 if claims["username"] != username:332 print('Token was not issued for this username')333 return 4334 if claims['iss'] != self.keys_iss:335 print('Token was not issued for this pool_id')336 return 5337 return 0338 def admin_list_users(self):339 attributes = ["email", "given_name", "family_name", "email"]340 params = {341 'UserPoolId' : self.pool_id,342 'AttributesToGet' : attributes343 }344 try:345 response = self.__get_client().list_users(**params)346 users = response.copy()347 users.pop("ResponseMetadata")348 #print(users)349 users = users["Users"]350 num_users = len(users)351 user_list = []352 for user in users:353 user_attributes = self.__cognito_to_dict(user["Attributes"])354 #print(user)355 user_attributes["username"] = user["Username"]356 user_attributes["creationdate"] = user["UserCreateDate"]357 user_attributes["modifieddate"] = user["UserLastModifiedDate"]358 user_attributes["enabled"] = user["Enabled"]359 user_attributes["status"] = user["UserStatus"]360 user_list.append(user_attributes)361 except:362 return (False, None)363 return (self.__get_result(response), user_list)364 def admin_display_users(self, users):365 print()366 if users:367 for user in users:368 print("username : {}".format(user["username"]))369 print(" email : {}".format(user["email"]))370 print(" given_name : {}".format(user["given_name"]))371 print(" family_name : {}".format(user["family_name"]))372 print(" creationdate : {}".format(user["creationdate"]))373 print(" modifieddate : {}".format(user["modifieddate"]))374 print(" enabled : {}".format(user["enabled"]))375 print(" status : {}".format(user["status"]))376 print()377 def admin_disable_user(self, username):378 params = {379 'UserPoolId' : self.pool_id,380 'Username' : username381 }382 try:383 response = self.__get_client().admin_disable_user(**params)384 except:385 return (False, None)386 return (self.__get_result(response), response)387 def admin_enable_user(self, username):388 params = {389 'UserPoolId' : self.pool_id,390 'Username' : username391 }392 try:393 response = self.__get_client().admin_enable_user(**params)394 except:395 return (False, None)396 return (self.__get_result(response), response)397 def admin_add_user_to_group(self, username, groupname):398 params = {399 'UserPoolId' : self.pool_id,400 'Username' : username,401 'GroupName' : groupname402 }403 try:404 response = self.__get_client().admin_add_user_to_group(**params)405 except:406 return (False, None)407 return (self.__get_result(response), response)408 def admin_remove_user_from_group(self, username, groupname):409 params = {410 'UserPoolId' : self.pool_id,411 'Username' : username,412 'GroupName' : groupname413 }414 try:415 response = self.__get_client().admin_remove_user_from_group(**params)416 except:417 return (False, None)418 return (self.__get_result(response), response)419 def admin_list_groups_for_user(self, username):420 params = {421 'Username' : username,422 'UserPoolId' : self.pool_id423 }424 try:425 response = self.__get_client().admin_list_groups_for_user(**params)426 groups = response.copy()427 groups.pop("ResponseMetadata")428 groups = groups["Groups"]429 #print(groups)430 num_users = len(groups)431 group_list = []432 for group in groups:433 group_attributes = {}434 group_attributes["groupname"] = group["GroupName"]435 #group_attributes["description"] = group["Description"]436 #group_attributes["modifieddate"] = str(group["LastModifiedDate"])437 #group_attributes["creationdate"] = str(group["CreationDate"])438 group_list.append(group_attributes)439 except:440 return (False, None)441 return (self.__get_result(response), group_list)442 def admin_display_groups_for_user(self, groups):443 print()444 if groups:445 for group in groups:446 print("groupname : {}".format(group["groupname"]))447 print(" description : {}".format(group["description"]))448 print(" modifieddate : {}".format(group["modifieddate"]))449 print(" creationdate : {}".format(group["creationdate"]))450 print()451 def admin_logout_user(self, username):452 params = {453 'UserPoolId': self.pool_id,454 'Username' : username455 }456 try:457 response = self.__get_client().admin_user_global_sign_out(**params)458 except:459 return (False, None)460 return (self.__get_result(response), response)461 def admin_delete_user(self, username):462 params = {463 'UserPoolId': self.pool_id,464 'Username' : username465 }466 try:467 response = self.__get_client().admin_delete_user(**params)468 except:469 return (False, None)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run yandex-tank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful