class WebsiteUser(HttpUser): tasks = [YunQianBaoMan] wait_time = between(1, 3) host = "https://tyqbapi.pmm2020.com/" # users = queryUsers() #多个用户 mobile = user_mobile() users = [] for i in range(mobile["start"], mobile["end"]): #(15001200238,15001200239): # users.append(i) queueData = queue.Queue() for userItem in users: queueData.put_nowait(userItem)
class WebsiteUser(HttpUser): tasks = [YunQianBaoMan] wait_time = between(1, 3) # host = "https://tyqbapi.pmm2020.com/" app_name = "云账本" host_key = "yzb_test_host" pz_obj = ZFAclassTestCase(TaskSet).loadConfigByAppAndKey(app_name,host_key) host = pz_obj["dict_value"] print("host====",host) # users = queryUsers() #多个用户 mobile = user_mobile() users = [] for i in range(mobile["start"],mobile["end"]): #(15001200238,15001200239): # users.append(i) queueData = queue.Queue() for userItem in users: queueData.put_nowait(userItem)
class WebsiteUser(HttpUser): tasks = [YunQianBaoMan] wait_time = between(1, 3) app_name = "云账本" host_key = "yzb_test_host" # host_key = "yzb_release_host" pz_obj = ZFAclassTestCase(TaskSet).loadConfigByAppAndKey( app_name, host_key) print("pz_obj====", pz_obj) host_values = json.loads(pz_obj["dict_value"]) host = host_values["native_host"] # users = queryUsers() #多个用户 mobile = user_mobile() users = [] for i in range(mobile["start"], mobile["end"]): #(15001200238,15001200239): # users.append(i) queueData = queue.Queue() for userItem in users: queueData.put_nowait(userItem)
class WebsiteUser(HttpUser): tasks = [CXSCLiuCheng] wait_time = between(1, 3) host = "None" # print(host) # users = queryUsers_ykf(0,20) #多个用户 # print("users===",users) # queueData = queue.Queue() # for user in users: # print("单个用户对象=====",user) # queueData.put_nowait(user) # def setup(self): # print('locust setup') mobile = user_mobile() users = [] queueData = queue.Queue() for i in range(mobile["start"], mobile["end"]): # users.append(i) queueData.put_nowait({"mobile": i})
class WebsiteUser(HttpUser): @events.test_start.add_listener def on_test_start(self,**kw): print("test is starting") tasks = [YunQianBaoMan] wait_time = between(0.1, 0.5) app_name = "云库房" # host_key = "ykf_test_host" host_key = "ykf_dev_host" pz_obj = ZFAclassTestCase(TaskSet).loadConfigByAppAndKey(app_name,host_key) host_values = json.loads(pz_obj["dict_value"]) host = host_values["native_host"] # users = queryUsers() #多个用户 mobile = user_mobile() users = [] for i in range(mobile["start"],mobile["end"]): #(15001200238,15001200239): # users.append(i) # queueData = Queue() queueData = queue.Queue() for userItem in users: print("yonghu---",userItem) queueData.put_nowait(userItem) print("用户队列=========",queueData)