-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added quotes to the test since those seem the most likely to stop working upon future code changes.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Specify a warning as text. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --warning 'A warning with "quotes"' \ | ||
> --skip-validation \ | ||
> --output dataset.json &>/dev/null | ||
|
||
TODO: Switch to use jq once it's available in a well-defined test environment. | ||
<https://github.com/nextstrain/augur/issues/1557> | ||
|
||
$ python3 -c 'import json, sys; print(json.load(sys.stdin)["meta"]["warning"])' < dataset.json | ||
A warning with "quotes" | ||
|
||
Add a warning from a markdown file. | ||
|
||
$ cat >warning.md <<~~ | ||
> A warning with "quotes". | ||
> ~~ | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --warning warning.md \ | ||
> --skip-validation \ | ||
> --output dataset.json &>/dev/null | ||
|
||
$ python3 -c 'import json, sys; print(json.load(sys.stdin)["meta"]["warning"])' < dataset.json | ||
A warning with "quotes". | ||
|
||
|
||
Note: there is an extra newline compared to the original contents. This extra | ||
newline is harmless and can be explained by `augur export` embedding the | ||
original trailing newline explicitly, followed by an additional trailing newline | ||
when writing to extracted-warning.md. |