300??Python?????????y???????
?????Leo Lee ???????[ 2017/6/30 10:22:02 ] ?????????????? ???? ???
????????????ApiTestEngine??????????kasi???????????Java????????????????飬???????????????????????“????????????????”??
????????????????????????????????Java?????????????????????????Python?????????????ú????????????????????
?????ж??????
????????coveralls???????ApiTestEngine?????????????????????????268?У???????300?С?
???????????????????????????Python?????????????????????????????????????????????LINES???????????????RELEVANT????????Python??????????????ate/runner.py?????????????????????????????????
???????????????????ate/testcase.py????е?parse????????????????35?У?Python???????2?С?
def parse(self?? testcase_template):
""" parse testcase_template?? replace all variables with bind value.
variables marker: ${variable}.
@param (dict) testcase_template
{
"request": {
"url": "http://127.0.0.1:5000/api/users/${uid}"??
"method": "POST"??
"headers": {
"Content-Type": "application/json"??
"authorization": "${authorization}"??
"random": "${random}"
}??
"body": "${data}"
}??
"response": {
"status_code": "${expected_status}"
}
}
@return (dict) parsed testcase with bind values
{
"request": {
"url": "http://127.0.0.1:5000/api/users/1000"??
"method": "POST"??
"headers": {
"Content-Type": "application/json"??
"authorization": "a83de0ff8d2e896dbd8efb81ba14e17d"??
"random": "A2dEx"
}??
"body": '{"name": "user"?? "password": "123456"}'
}??
"response": {
"status_code": 201
}
}
"""
return self.substitute(testcase_template)
?????????????????????????????????731?У??????Python???????????1000?е????????????????????????????????????????????????90%??????????????????治??????????????????????
??????????300?е?Python??????????????Щ???????
?????????????????????????????????ApiTestEngine?????й滮???????????????????????????????????????????????????????????
?????????API??????????????????? GET/POST/HEAD/PUT/DELETE ??
??????????????????????????????????????????????YAML/JSON
???????????????????????б???????????ü???????????????????????????
??????????????????п????????????????????????
???????????з????????????????ò?????????????ò?????????????в???
????????п?????????????????Web????
??????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????Locust??
???????????μ????????????????У??????????????????????????Python???????????????500?С?
????????????????????????????????????壬д???д??????????????
????????????Guido van Rossum???????
????Life is short?? go Pythonic!
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11