Skip to content

Commit dc0ead3

Browse files
committed
initial test
1 parent 5c7b445 commit dc0ead3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

services/storage/tests/unit/test_handlers_paths.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,3 +449,43 @@ async def test_list_paths_with_display_name_containing_slashes(
449449
) / quote(
450450
node_name_with_non_ascii, safe=""
451451
), "display path parts should be url encoded"
452+
453+
454+
@pytest.mark.parametrize(
455+
"project_params",
456+
[
457+
ProjectWithFilesParams(
458+
num_nodes=5,
459+
allowed_file_sizes=(TypeAdapter(ByteSize).validate_python("1b"),),
460+
workspace_files_count=10,
461+
)
462+
],
463+
ids=str,
464+
)
465+
async def test_path_compute_size(
466+
initialized_app: FastAPI,
467+
client: httpx.AsyncClient,
468+
location_id: LocationID,
469+
user_id: UserID,
470+
with_random_project_with_files: tuple[
471+
dict[str, Any],
472+
dict[NodeID, dict[SimcoreS3FileID, FileIDDict]],
473+
],
474+
):
475+
project, list_of_files = with_random_project_with_files
476+
url = url_from_operation_id(
477+
client,
478+
initialized_app,
479+
"compute_path_total_size",
480+
location_id=f"{location_id}",
481+
path=project["uuid"],
482+
).with_query(user_id=user_id)
483+
response = await client.post(f"{url}")
484+
485+
received_size, _ = assert_status(
486+
response,
487+
status.HTTP_200_OK,
488+
ByteSize,
489+
)
490+
assert received_size
491+
assert received_size == 169

0 commit comments

Comments
 (0)