Skip to content

Commit 74d8abc

Browse files
committed
update tests explanation
1 parent 06e0ad0 commit 74d8abc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

services/staging/tests/test_staging.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,17 @@ async def test_get_job(
255255
Args:
256256
mocker: A mocker object used to create mocks and patches for testing.
257257
staging_client: A test client for making requests to the FastAPI application.
258+
mock_jobs: Fixture used to mock output of tiny db jobs
258259
expected_job (dict): The expected job dictionary containing job_id,
259260
status, progress, and message for the job to be retrieved.
261+
expected_status: response HTTP status code
262+
expected_response: response body (JSON object)
260263
261264
Assertions:
262265
- Asserts that the response status code is 200 and the returned job
263266
details match the expected job dictionary when the job exists.
264267
- Asserts that the response status code is 404 when the job does not exist.
268+
- Asserts that the response status code is 500 if other exception occurs.
265269
"""
266270
# Mock app.extra to ensure 'db_table' exists
267271
mock_db_table = mocker.MagicMock()
@@ -325,13 +329,17 @@ async def test_get_job_result(
325329
Args:
326330
mocker: A mocker object used to create mocks and patches for testing.
327331
staging_client: A test client for making requests to the FastAPI application.
332+
mock_jobs: Fixture used to mock output of tiny db jobs
328333
expected_job (dict): The expected job dictionary containing job_id,
329334
status, progress, and message for the job whose results are to be retrieved.
335+
expected_status: response HTTP status code
336+
expected_response: response body (JSON object)
330337
331338
Assertions:
332339
- Asserts that the response status code is 200 and the returned job result
333340
matches the expected job status when the job exists.
334341
- Asserts that the response status code is 404 when the job does not exist.
342+
- Asserts that the response status code is 500 if other exception occurs.
335343
"""
336344
# Mock app.extra to ensure 'db_table' exists
337345
mock_db_table = mocker.MagicMock()

0 commit comments

Comments
 (0)