This repository was archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Add functionality to catch many upload problems at once and return them all #141
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
83725d9
add the ability to catch all issues at once for csv files and a file …
JackWilb 9350c91
remove testing code
JackWilb d681d93
move the utf8 decoding check down to where the decoding happens
JackWilb 27c8332
add the ability to catch all issues at once for csv files and a file …
JackWilb 4799d84
remove testing code
JackWilb 50636e4
move the utf8 decoding check down to where the decoding happens
JackWilb bce6b26
change decode error to not utf
JackWilb bdb42a6
add files to test newick imports and add validation to newick files s…
JackWilb eb951d3
fix merge conflicts
JackWilb b86c4bb
fix issue with duplicate edges
JackWilb 71b739b
fix testing for the decode function and move the decode function outs…
JackWilb 360afd9
fix merge conflict from stashed changes and separate out the data dec…
JackWilb f75363a
Merge branch 'master' into upload-validation-errors
JackWilb 8f5b99d
remove problematic files
JackWilb 86a24f0
fix the newick uploader to be consistent with csv (returns) and add a…
JackWilb 7bacd3f
Merge branch 'master' into upload-validation-errors
JackWilb b8137b3
Merge branch 'master' into upload-validation-errors
JackWilb 6a6912e
Merge branch 'master' into upload-validation-errors
JackWilb 3ebc271
fix tests to be more concise
JackWilb 46e2d66
fix error handling in the validation checks
JackWilb b7941f7
fix test to deal with the new error raising
JackWilb fd830ed
Revert "fix test to deal with the new error raising"
JackWilb 8baf84f
Fix tests for new methodology after rolling back the past commits
JackWilb 7e37fe0
Merge branch 'master' into upload-validation-errors
JackWilb 7e2541b
move decode_data to utils and clean up some unneeded code
JackWilb 0d56835
Merge branch 'upload-validation-errors' of github.com:multinet-app/mu…
JackWilb 37298f8
update the decode error to take only one error, not a list
JackWilb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| (B,(A,C,E),D); |
This file contains hidden or 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 @@ | ||
| (B,(A,C,A),D); |
Binary file not shown.
Binary file not shown.
This file contains hidden or 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 hidden or 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,35 @@ | ||
| """Tests functions in the Neick Uploader Flask Blueprint.""" | ||
| import newick | ||
| import os | ||
| import pytest | ||
|
|
||
| from multinet.errors import ValidationFailed, DecodeFailed | ||
| from multinet.uploaders.newick import validate_newick, decode_data | ||
|
|
||
| TEST_DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) | ||
|
|
||
|
|
||
| def test_validate_newick(): | ||
| """Tests the validate_csv function.""" | ||
| duplicate_keys_file_path = os.path.join( | ||
| TEST_DATA_DIR, "basic_newick_duplicates.tree" | ||
| ) | ||
|
|
||
| # Test duplicate keys | ||
| with open(duplicate_keys_file_path) as test_file: | ||
| test_file = test_file.read() | ||
|
|
||
| body = newick.loads(test_file) | ||
|
|
||
| with pytest.raises(ValidationFailed) as v_error: | ||
| validate_newick(body) | ||
|
|
||
| validation_resp = v_error.value.errors[0] | ||
| assert "error" in validation_resp.keys() | ||
|
|
||
| # Test unicode decode errors | ||
| test_data = ( | ||
| b"\xff\xfe(\x00B\x00,\x00(\x00A\x00," | ||
| b"\x00C\x00,\x00E\x00)\x00,\x00D\x00)\x00;\x00\n\x00" | ||
| ) | ||
| pytest.raises(DecodeFailed, decode_data, test_data) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.