Skip to content

Commit

Permalink
Tests for the new behavior of transform-genbank-location [#35]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed May 20, 2024
1 parent 88142a4 commit 6066d28
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/transform-genbank-location/transform-genbank-location.t
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"}

0 comments on commit 6066d28

Please sign in to comment.