commit 031047aef7e363b3cfd11d703f9b87e45e8e6931 Author: tongli Date: Fri Jan 4 18:31:34 2019 +0800 nice diff --git a/BeanShell.java b/BeanShell.java new file mode 100644 index 0000000..00950d9 --- /dev/null +++ b/BeanShell.java @@ -0,0 +1 @@ +print('hello world') \ No newline at end of file diff --git a/C-C++路径.xlsx b/C-C++路径.xlsx new file mode 100644 index 0000000..18f7b41 Binary files /dev/null and b/C-C++路径.xlsx differ diff --git a/locustfile.py b/locustfile.py new file mode 100644 index 0000000..0cce8b6 --- /dev/null +++ b/locustfile.py @@ -0,0 +1,49 @@ +from locust import HttpLocust, TaskSet, task +import json + + +class UserBehavior(TaskSet): + + token = '' + userId = '' + headers = '' + + def login(self): + data = { + "email": "xxxxxxx", + "passwd": "xxxxxxx", + } + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json'} + response = self.client.post( + 'xxxxxx/login', + data=json.dumps(data), + headers=headers) + content = json.loads(response.content) + self.token = {"token": content['data']['token']} + self.userId = content['data']['userId'] + + def logout(self): + with self.client.get('xxxxxx/logout', params=self.token, catch_response=True) as response: + if response.status_code != 200: + response.failure() + + def user_details(self): + data = {'userId': self.userId} + with self.client.get('xxxxxxxx/view', params=data, headers=self.headers, catch_response=True) as response: + if response.status_code != 200: + response.failure() + + @task(10) + def login_logout(self): + self.login() + self.user_details() + self.logout() + + +class WebsiteUser(HttpLocust): + host = 'http://10.1.51.221:7600/' + task_set = UserBehavior + min_wait = 5000 + max_wait = 9000 \ No newline at end of file diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..3d7f848 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +33333 \ No newline at end of file diff --git a/奶毒1470配装.jpg b/奶毒1470配装.jpg new file mode 100644 index 0000000..c991d26 Binary files /dev/null and b/奶毒1470配装.jpg differ