Skip to content

Commit

Permalink
Check duplicated files
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Nov 12, 2024
1 parent d46e253 commit 5bd6cb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mars-cli/mars_lib/isa_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ def map_data_files_to_repositories(
Please correct the mismatch!"""
)
else:
remaining_files.remove(
next(fd for fd in files_dicts if fd["short_name"] == adf)
)
remaining_files = [
fd for fd in remaining_files if fd["short_name"] != adf
]

df_map[target_repo_comment.value] = [
fd["full_name"]
Expand Down
7 changes: 6 additions & 1 deletion mars-cli/tests/test_isa_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def test_map_data_files_to_repositories():
):
map_data_files_to_repositories(not_enough_files, isa_json)

too_many_files = exact_match_files
too_many_files = exact_match_files.copy()
one_too_many = "../test-data/ISA-BH2024-ALL/one-too-many.fastq"
too_many_files.append(one_too_many)

Expand All @@ -321,3 +321,8 @@ def test_map_data_files_to_repositories():
assert one_too_many not in [
value for key, value_list in result_maps.items() for value in value_list
]

duplicated_files = exact_match_files.copy()
duplicated_files.append(exact_match_files[-1])

map_data_files_to_repositories(duplicated_files, isa_json)

0 comments on commit 5bd6cb4

Please sign in to comment.