diff --git a/tests/api_server.py b/tests/api_server.py index 4cf6b0fb..6919b274 100644 --- a/tests/api_server.py +++ b/tests/api_server.py @@ -93,6 +93,7 @@ def validate_request(func): def index(): return "Hello World!" + @app.route('/api/get-token', methods=['POST']) def get_token(): device_sn = request.headers.get('device_sn', "") @@ -121,6 +122,7 @@ def get_token(): response.headers["Content-Type"] = "application/json" return response + @app.route('/api/users') @validate_request def get_users(): @@ -134,6 +136,7 @@ def get_users(): response.headers["Content-Type"] = "application/json" return response + @app.route('/api/reset-all') @validate_request def clear_users(): @@ -145,6 +148,7 @@ def clear_users(): response.headers["Content-Type"] = "application/json" return response + @app.route('/api/users/', methods=['POST']) @validate_request def create_user(uid): @@ -167,6 +171,7 @@ def create_user(uid): response.headers["Content-Type"] = "application/json" return response + @app.route('/api/users/') @validate_request def get_user(uid): @@ -188,6 +193,7 @@ def get_user(uid): response.headers["Content-Type"] = "application/json" return response + @app.route('/api/users/', methods=['PUT']) @validate_request def update_user(uid): @@ -209,6 +215,7 @@ def update_user(uid): response.headers["Content-Type"] = "application/json" return response + @app.route('/api/users/', methods=['DELETE']) @validate_request def delete_user(uid): diff --git a/tests/base.py b/tests/base.py index 9e1e09b2..86da90fb 100644 --- a/tests/base.py +++ b/tests/base.py @@ -33,7 +33,7 @@ class ApiServerUnittest(unittest.TestCase): ) cls.flask_process.start() cls.httpbin_process.start() - time.sleep(0.1) + time.sleep(1) cls.api_client = requests.Session() @classmethod