-
Notifications
You must be signed in to change notification settings - Fork 0
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 #36 from nextstrain/noisify-genebank-transform-35
Noisify genebank transform
- Loading branch information
Showing
2 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
tests/transform-genbank-location/transform-genbank-location.t
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,30 @@ | ||
Verify behavior of `transform-genbank-location` around prescence/abscence of | ||
`database` and `location` fields. | ||
|
||
If `location` field is present, transform it. | ||
|
||
$ echo '{"database":"GenBank", "location": "USA:Oregon, Salem" }' \ | ||
> | $TESTDIR/../../transform-genbank-location | ||
{"database":"GenBank","location":"Salem","country":"USA","division":"Oregon"} | ||
|
||
If `database` field is absent, complain. | ||
|
||
$ echo '{"location": "USA:Oregon, Salem" }' \ | ||
> | $TESTDIR/../../transform-genbank-location | ||
Record must contain `database` field to use `transform-genbank-location.` | ||
{"location":"USA:Oregon, Salem"} | ||
|
||
If `database` field has unsupported value, complain. | ||
|
||
$ echo '{"database": "unsupported", "location": "USA:Oregon, Salem" }' \ | ||
> | $TESTDIR/../../transform-genbank-location | ||
Database value of unsupported not supported for `transform-genbank-location`; must be "GenBank" or "RefSeq". | ||
{"database":"unsupported","location":"USA:Oregon, Salem"} | ||
|
||
|
||
If `location` field is absent, complain. | ||
|
||
$ echo '{"database": "GenBank" }' \ | ||
> | $TESTDIR/../../transform-genbank-location | ||
`transform-genbank-location` requires a `location` field; this record does not have one. | ||
{"database":"GenBank"} |
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