-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed + improved dv-dataset-destroy-migration-placeholder (#54)
* Modified dv-dataset-destroy-migration-placeholder so that it also recognizes easy-migration.zip as a placeholder file, and not only and easy-migration folder. * - Implemented missing dry-run option for dv-dataset-destroy-migration-placeholder - Refactored filtering on datasets with only 'easy-migration' files + also allowing easy-migration.zip as 'easy-migration' file (formerly, easy-migration was expected to be a directory containing up to 4 files).
- Loading branch information
1 parent
0b4debf
commit cedc59f
Showing
4 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import datastation.dataverse.destroy_placeholder_dataset | ||
|
||
|
||
def test_is_migration_file_returns_true_for_file_with_label_easy_migration_dot_zip(): | ||
file_metadata = {'label': 'easy-migration.zip'} | ||
assert datastation.dataverse.destroy_placeholder_dataset.is_migration_file(file_metadata) == True | ||
|
||
|
||
def test_is_migration_file_returns_true_for_file_with_directory_label_easy_migration(): | ||
file_metadata = {'directoryLabel': 'easy-migration'} | ||
assert datastation.dataverse.destroy_placeholder_dataset.is_migration_file(file_metadata) == True | ||
|
||
|
||
def test_is_migration_file_returns_false_for_file_with_label_not_easy_migration_dot_zip(): | ||
file_metadata = {'label': 'not-easy-migration.zip'} | ||
assert datastation.dataverse.destroy_placeholder_dataset.is_migration_file(file_metadata) == False | ||
|
||
|
||
def test_is_migration_file_returns_false_for_file_with_directory_label_not_easy_migration(): | ||
file_metadata = {'directoryLabel': 'not-easy-migration'} | ||
assert datastation.dataverse.destroy_placeholder_dataset.is_migration_file(file_metadata) == False | ||
|