@@ -371,7 +371,7 @@ async def test_list_paths(
371371 ProjectWithFilesParams (
372372 num_nodes = 1 ,
373373 allowed_file_sizes = (TypeAdapter (ByteSize ).validate_python ("0b" ),),
374- workspace_files_count = 0 ,
374+ workspace_files_count = 10 ,
375375 )
376376 ],
377377 ids = str ,
@@ -449,3 +449,38 @@ 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+ # ls in the node workspace
454+ selected_node_id = NodeID (random .choice (list (project ["workbench" ]))) # noqa: S311
455+ selected_node_s3_keys = [
456+ Path (s3_object_id ) for s3_object_id in list_of_files [selected_node_id ]
457+ ]
458+ workspace_file_filter = file_filter / f"{ selected_node_id } " / "workspace"
459+ expected_paths = _filter_and_group_paths_one_level_deeper (
460+ selected_node_s3_keys , workspace_file_filter
461+ )
462+ await _assert_list_paths (
463+ initialized_app ,
464+ client ,
465+ location_id ,
466+ user_id ,
467+ file_filter = workspace_file_filter ,
468+ expected_paths = expected_paths ,
469+ check_total = False ,
470+ )
471+
472+ # ls in until we get to some files
473+ while selected_subfolders := [p for p in expected_paths if p [1 ] is False ]:
474+ selected_path_filter = random .choice (selected_subfolders ) # noqa: S311
475+ expected_paths = _filter_and_group_paths_one_level_deeper (
476+ selected_node_s3_keys , selected_path_filter [0 ]
477+ )
478+ await _assert_list_paths (
479+ initialized_app ,
480+ client ,
481+ location_id ,
482+ user_id ,
483+ file_filter = selected_path_filter [0 ],
484+ expected_paths = expected_paths ,
485+ check_total = False ,
486+ )
0 commit comments