From 6557cc9b1bc1617e3a86c7be45254936ce32f409 Mon Sep 17 00:00:00 2001 From: huchenlei Date: Thu, 31 Oct 2024 17:25:23 -0400 Subject: [PATCH] Fix mock --- app/user_manager.py | 2 ++ tests-unit/prompt_server_test/user_manager_test.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/user_manager.py b/app/user_manager.py index cf8eac979..e47b2fd4b 100644 --- a/app/user_manager.py +++ b/app/user_manager.py @@ -234,6 +234,8 @@ class UserManager(): - file: The target file path (URL encoded if necessary). Returns: + - 400: If 'file' parameter is missing. + - 403: If the requested path is not allowed. - 409: If overwrite=false and the file already exists. - 200: JSON response with either: - Full file information (if full_info=true) diff --git a/tests-unit/prompt_server_test/user_manager_test.py b/tests-unit/prompt_server_test/user_manager_test.py index 91a427263..3db426b8d 100644 --- a/tests-unit/prompt_server_test/user_manager_test.py +++ b/tests-unit/prompt_server_test/user_manager_test.py @@ -14,7 +14,7 @@ def user_manager(tmp_path): um = UserManager() um.get_request_user_filepath = lambda req, file, **kwargs: os.path.join( tmp_path, file - ) + ) if file else tmp_path return um