mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
change: rename builtin function, sleep_N_secs => sleep
This commit is contained in:
@@ -46,6 +46,12 @@ def get_current_date(fmt="%Y-%m-%d"):
|
|||||||
return datetime.datetime.now().strftime(fmt)
|
return datetime.datetime.now().strftime(fmt)
|
||||||
|
|
||||||
|
|
||||||
|
def sleep(n_secs):
|
||||||
|
""" sleep n seconds
|
||||||
|
"""
|
||||||
|
time.sleep(n_secs)
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## upload files with requests-toolbelt
|
## upload files with requests-toolbelt
|
||||||
# e.g.
|
# e.g.
|
||||||
@@ -198,12 +204,3 @@ def startswith(check_value, expect_value):
|
|||||||
|
|
||||||
def endswith(check_value, expect_value):
|
def endswith(check_value, expect_value):
|
||||||
assert builtin_str(check_value).endswith(builtin_str(expect_value))
|
assert builtin_str(check_value).endswith(builtin_str(expect_value))
|
||||||
|
|
||||||
|
|
||||||
""" built-in hooks
|
|
||||||
"""
|
|
||||||
|
|
||||||
def sleep_N_secs(n_secs):
|
|
||||||
""" sleep n seconds
|
|
||||||
"""
|
|
||||||
time.sleep(n_secs)
|
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ class TestRunner(ApiServerUnittest):
|
|||||||
"name": "basic test with httpbin",
|
"name": "basic test with httpbin",
|
||||||
"base_url": HTTPBIN_SERVER,
|
"base_url": HTTPBIN_SERVER,
|
||||||
"setup_hooks": [
|
"setup_hooks": [
|
||||||
"${sleep_N_secs(0.5)}",
|
"${sleep(0.5)}",
|
||||||
"${hook_print(setup)}"
|
"${hook_print(setup)}"
|
||||||
],
|
],
|
||||||
"teardown_hooks": [
|
"teardown_hooks": [
|
||||||
"${sleep_N_secs(1)}",
|
"${sleep(1)}",
|
||||||
"${hook_print(teardown)}"
|
"${hook_print(teardown)}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user