Skip to content

Commit 4f2f270

Browse files
committed
@pcrespov review: renaming
1 parent 5d7a30d commit 4f2f270

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

services/storage/openapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,8 @@
10831083
"tags": [
10841084
"files"
10851085
],
1086-
"summary": "Compute Path Total Size",
1087-
"operationId": "compute_path_total_size_v0_locations__location_id__paths__path__size_post",
1086+
"summary": "Compute Path Size",
1087+
"operationId": "compute_path_size_v0_locations__location_id__paths__path__size_post",
10881088
"parameters": [
10891089
{
10901090
"name": "path",

services/storage/src/simcore_service_storage/api/rest/_paths.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ async def list_paths(
5656
"/locations/{location_id}/paths/{path:path}:size",
5757
response_model=Envelope[PathTotalSizeCreate],
5858
)
59-
async def compute_path_total_size(
59+
async def compute_path_size(
6060
dsm: Annotated[BaseDataManager, Depends(get_data_manager)],
6161
user_id: UserID,
6262
path: Path,
6363
):
6464
return Envelope[PathTotalSizeCreate](
6565
data=PathTotalSizeCreate(
66-
path=path, size=await dsm.compute_path_total_size(user_id, path=path)
66+
path=path, size=await dsm.compute_path_size(user_id, path=path)
6767
)
6868
)

services/storage/src/simcore_service_storage/datcore_dsm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async def list_paths(
188188
1,
189189
)
190190

191-
async def compute_path_total_size(self, user_id: UserID, *, path: Path) -> ByteSize:
191+
async def compute_path_size(self, user_id: UserID, *, path: Path) -> ByteSize:
192192
"""returns the total size of an arbitrary path"""
193193
api_token, api_secret = await self._get_datcore_tokens(user_id)
194194
api_token, api_secret = _check_api_credentials(api_token, api_secret)

services/storage/src/simcore_service_storage/dsm_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def list_paths(
8181
"""returns a page of the file meta data a user has access to"""
8282

8383
@abstractmethod
84-
async def compute_path_total_size(self, user_id: UserID, *, path: Path) -> ByteSize:
84+
async def compute_path_size(self, user_id: UserID, *, path: Path) -> ByteSize:
8585
"""returns the total size of an arbitrary path"""
8686

8787
@abstractmethod

services/storage/src/simcore_service_storage/simcore_s3_dsm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async def list_paths(
244244

245245
return paths_metadata, next_cursor, total
246246

247-
async def compute_path_total_size(self, user_id: UserID, *, path: Path) -> ByteSize:
247+
async def compute_path_size(self, user_id: UserID, *, path: Path) -> ByteSize:
248248
"""returns the total size of an arbitrary path"""
249249
# check access rights first
250250
project_id = None

services/storage/tests/unit/test_handlers_paths.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ async def test_list_paths_with_display_name_containing_slashes(
519519
)
520520
assert page_of_paths.items[0].display_path == Path(
521521
quote(project_name_with_slashes, safe="")
522-
) / quote(node_name_with_non_ascii, safe=""), (
523-
"display path parts should be url encoded"
524-
)
522+
) / quote(
523+
node_name_with_non_ascii, safe=""
524+
), "display path parts should be url encoded"
525525

526526
# ls in the node workspace
527527
selected_node_id = NodeID(random.choice(list(project["workbench"]))) # noqa: S311
@@ -565,12 +565,12 @@ async def test_list_paths_with_display_name_containing_slashes(
565565
*(expected_paths[0][0].parts[2:]),
566566
],
567567
)
568-
assert page_of_paths.items[0].display_path == Path(expected_display_path), (
569-
"display path parts should be url encoded"
570-
)
568+
assert page_of_paths.items[0].display_path == Path(
569+
expected_display_path
570+
), "display path parts should be url encoded"
571571

572572

573-
async def _assert_compute_path_total_size(
573+
async def _assert_compute_path_size(
574574
initialized_app: FastAPI,
575575
client: httpx.AsyncClient,
576576
location_id: LocationID,
@@ -582,7 +582,7 @@ async def _assert_compute_path_total_size(
582582
url = url_from_operation_id(
583583
client,
584584
initialized_app,
585-
"compute_path_total_size",
585+
"compute_path_size",
586586
location_id=f"{location_id}",
587587
path=f"{path}",
588588
).with_query(user_id=user_id)
@@ -627,9 +627,9 @@ async def test_path_compute_size(
627627
],
628628
project_params: ProjectWithFilesParams,
629629
):
630-
assert len(project_params.allowed_file_sizes) == 1, (
631-
"test preconditions are not filled! allowed file sizes should have only 1 option for this test"
632-
)
630+
assert (
631+
len(project_params.allowed_file_sizes) == 1
632+
), "test preconditions are not filled! allowed file sizes should have only 1 option for this test"
633633
project, list_of_files = with_random_project_with_files
634634

635635
total_num_files = sum(
@@ -639,7 +639,7 @@ async def test_path_compute_size(
639639
# get size of a full project
640640
expected_total_size = project_params.allowed_file_sizes[0] * total_num_files
641641
path = Path(project["uuid"])
642-
await _assert_compute_path_total_size(
642+
await _assert_compute_path_size(
643643
initialized_app,
644644
client,
645645
location_id,
@@ -657,7 +657,7 @@ async def test_path_compute_size(
657657
expected_total_size = project_params.allowed_file_sizes[0] * len(
658658
selected_node_s3_keys
659659
)
660-
await _assert_compute_path_total_size(
660+
await _assert_compute_path_size(
661661
initialized_app,
662662
client,
663663
location_id,
@@ -676,7 +676,7 @@ async def test_path_compute_size(
676676
expected_total_size = project_params.allowed_file_sizes[0] * len(
677677
selected_node_s3_keys
678678
)
679-
await _assert_compute_path_total_size(
679+
await _assert_compute_path_size(
680680
initialized_app,
681681
client,
682682
location_id,
@@ -695,7 +695,7 @@ async def test_path_compute_size(
695695
expected_total_size = project_params.allowed_file_sizes[0] * len(
696696
selected_node_s3_keys
697697
)
698-
workspace_total_size = await _assert_compute_path_total_size(
698+
workspace_total_size = await _assert_compute_path_size(
699699
initialized_app,
700700
client,
701701
location_id,
@@ -720,7 +720,7 @@ async def test_path_compute_size(
720720
expected_total_size = project_params.allowed_file_sizes[0] * len(
721721
selected_node_s3_keys
722722
)
723-
accumulated_subfolder_size += await _assert_compute_path_total_size(
723+
accumulated_subfolder_size += await _assert_compute_path_size(
724724
initialized_app,
725725
client,
726726
location_id,
@@ -740,7 +740,7 @@ async def test_path_compute_size_inexistent_path(
740740
faker: Faker,
741741
fake_datcore_tokens: tuple[str, str],
742742
):
743-
await _assert_compute_path_total_size(
743+
await _assert_compute_path_size(
744744
initialized_app,
745745
client,
746746
location_id,

0 commit comments

Comments
 (0)