Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan King committed Jan 20, 2024
1 parent dcbdc35 commit ee1ae6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions hail/python/test/hailtop/inter_cloud/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,8 @@ async def test_file_and_directory_error_with_slash_non_empty_file(
)


async def test_file_and_directory_error_with_slash_non_empty_file_only_for_google_non_recursive(
router_filesystem: Tuple[asyncio.Semaphore, AsyncFS, Dict[str, str]], copy_tool
async def test_copying_a_folder_with_only_a_size_zero_directory_named_file_copies_nothing_and_does_not_error_in_google(
router_filesystem: Tuple[asyncio.Semaphore, AsyncFS, Dict[str, str]],
):
sema, fs, bases = router_filesystem

Expand All @@ -739,7 +739,9 @@ async def test_file_and_directory_error_with_slash_non_empty_file_only_for_googl
Transfer.INFER_DEST,
):
dest_base = await fresh_dir(fs, bases, 'gs')
await copy_tool(
await Copier.copy( # hailctl fs sync errors when the source is an empty directory or
# non-extant file (excluding the size-zero, ending in trailing slash
# files).
fs,
sema,
Transfer(
Expand All @@ -754,10 +756,9 @@ async def test_file_and_directory_error_with_slash_non_empty_file_only_for_googl
await collect_files(await fs.listfiles(f'{dest_base}empty-only/'))


async def test_file_and_directory_error_with_slash_empty_file_only(
async def test_copying_a_folder_with_only_a_size_zero_directory_named_file_copies_nothing_and_does_not_error(
router_filesystem: Tuple[asyncio.Semaphore, AsyncFS, Dict[str, str]],
cloud_scheme: str,
copy_tool,
):
sema, fs, bases = router_filesystem

Expand All @@ -774,7 +775,9 @@ async def test_file_and_directory_error_with_slash_empty_file_only(
Transfer.INFER_DEST,
):
dest_base = await fresh_dir(fs, bases, cloud_scheme)
await copy_tool(
await Copier.copy( # hailctl fs sync errors when the source is an empty directory or
# non-extant file (excluding the size-zero, ending in trailing slash
# files).
fs,
sema,
Transfer(
Expand All @@ -788,7 +791,9 @@ async def test_file_and_directory_error_with_slash_empty_file_only(
await collect_files(await fs.listfiles(f'{dest_base}empty-only/', recursive=True))

dest_base = await fresh_dir(fs, bases, cloud_scheme)
await copy_tool(
await Copier.copy( # hailctl fs sync errors when the source is an empty directory or
# non-extant file (excluding the size-zero, ending in trailing slash
# files).
fs,
sema,
Transfer(f'{src_base}', dest_base.rstrip('/'), treat_dest_as=transfer_type),
Expand Down
2 changes: 1 addition & 1 deletion hail/python/test/hailtop/inter_cloud/test_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ async def test_basename_of_file_ending_in_slash_is_empty_in_cloud(
if base.scheme in ('', 'file'):
return

await fs.write(f'{base}file-is-folder/', b'')
await fs.write(base.with_new_path_component('file-is-folder/'), b'')

files = [x async for x in await fs.listfiles(str(base))]
assert len(files) == 1
Expand Down

0 comments on commit ee1ae6e

Please sign in to comment.