-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #992 from dandi/validation_errors
Logging validation warnings and errors
- Loading branch information
Showing
4 changed files
with
93 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
from click.testing import CliRunner | ||
|
||
|
||
def test_validate_bids_error(bids_examples): | ||
from ..cmd_validate import validate_bids | ||
|
||
expected_error = ( | ||
"Summary: 2 filename patterns required by BIDS could not be found " | ||
"and 1 filename did not match any pattern known to BIDS.\n" | ||
) | ||
broken_dataset = os.path.join(bids_examples, "invalid_pet001") | ||
r = CliRunner().invoke(validate_bids, [broken_dataset]) | ||
# Does it break? | ||
assert r.exit_code == 1 | ||
|
||
# Does it report the issue correctly? | ||
assert r.output == expected_error |
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