mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-20 07:40:32 +08:00
move public functions to utils.py
This commit is contained in:
16
ate/utils.py
16
ate/utils.py
@@ -1,8 +1,22 @@
|
||||
import hashlib
|
||||
import json
|
||||
import yaml
|
||||
import os.path
|
||||
import random
|
||||
import string
|
||||
|
||||
import yaml
|
||||
|
||||
from ate.exception import ParamsError
|
||||
|
||||
|
||||
def gen_random_string(str_len):
|
||||
return ''.join(
|
||||
random.choice(string.ascii_letters + string.digits) for _ in range(str_len))
|
||||
|
||||
def gen_md5(str_list):
|
||||
authorization_str = "".join(str_list)
|
||||
return hashlib.md5(authorization_str.encode('utf-8')).hexdigest()
|
||||
|
||||
def load_yaml_file(yaml_file):
|
||||
with open(yaml_file, 'r+') as stream:
|
||||
return yaml.load(stream)
|
||||
|
||||
Reference in New Issue
Block a user