change: rename builtin function, sleep_N_secs => sleep

This commit is contained in:
debugtalk
2019-11-03 15:54:59 +08:00
parent 11f5bd6abd
commit b183403b84
2 changed files with 8 additions and 11 deletions

View File

@@ -46,6 +46,12 @@ def get_current_date(fmt="%Y-%m-%d"):
return datetime.datetime.now().strftime(fmt)
def sleep(n_secs):
""" sleep n seconds
"""
time.sleep(n_secs)
###############################################################################
## upload files with requests-toolbelt
# e.g.
@@ -198,12 +204,3 @@ def startswith(check_value, expect_value):
def endswith(check_value, 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)

View File

@@ -52,11 +52,11 @@ class TestRunner(ApiServerUnittest):
"name": "basic test with httpbin",
"base_url": HTTPBIN_SERVER,
"setup_hooks": [
"${sleep_N_secs(0.5)}",
"${sleep(0.5)}",
"${hook_print(setup)}"
],
"teardown_hooks": [
"${sleep_N_secs(1)}",
"${sleep(1)}",
"${hook_print(teardown)}"
]
},