From 7cbcd1eb7469528f84418162a7b482ef86f2f0fc Mon Sep 17 00:00:00 2001 From: hacktobeer Date: Wed, 7 Aug 2024 16:07:15 +0200 Subject: [PATCH] change naming to reflect it downloads from output --- turbinia/api/api_server_test.py | 8 ++++---- turbinia/api/openapi.yaml | 2 +- turbinia/api/routes/download.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/turbinia/api/api_server_test.py b/turbinia/api/api_server_test.py index ef861401c..ebb6257ad 100644 --- a/turbinia/api/api_server_test.py +++ b/turbinia/api/api_server_test.py @@ -483,14 +483,14 @@ def testGetJobs(self): result = json.loads(result.content) self.assertEqual(expected_result, result) - def testDownloadNotFound(self): - """Test downloading non existent file path.""" + def testDownloadOutputNotFound(self): + """Test downloading non existent output file path.""" file_path = '/non-existing/path with space/does-not-exist.txt' response = self.client.get(f'/api/download/output/{file_path}') self.assertEqual(response.status_code, 404) - def testDownload(self): - """Test downloading file path.""" + def testDownloadOutput(self): + """Test downloading output file path.""" turbinia_config.OUTPUT_DIR = str( os.path.dirname(os.path.realpath(__file__))) file_path = f'{turbinia_config.OUTPUT_DIR}/api_server_test.py' diff --git a/turbinia/api/openapi.yaml b/turbinia/api/openapi.yaml index ce2e3bc39..84a423110 100644 --- a/turbinia/api/openapi.yaml +++ b/turbinia/api/openapi.yaml @@ -221,7 +221,7 @@ paths: get: description: "Download by path.\n\nRaises:\nHTTPException: if another\ \ exception is caught." - operationId: download_file_path + operationId: download_output_path parameters: - in: path name: file_path diff --git a/turbinia/api/routes/download.py b/turbinia/api/routes/download.py index 8df7cca55..96855e3ad 100644 --- a/turbinia/api/routes/download.py +++ b/turbinia/api/routes/download.py @@ -28,8 +28,8 @@ @router.get('/output/{file_path:path}') -async def download_file_path(request: Request, file_path): - """Downloads evidence file path. +async def download_output_path(request: Request, file_path): + """Downloads output file path. Args: file_path (str): Path to file.