55Create files for testing.
66
77 $ cat > metadata. tsv << ~~
8- > strain field_A field_A__url
9- > tipA nextstrain https: // nextstrain. org
10- > tipB BB: not-a-url
11- > tipC github https: // github. com
12- > tipD DD <not-a-url >
13- > tipE EE invalid-url
14- > tipF FF
8+ > strain field_A field_A__url field_B field_B__url
9+ > tipA nextstrain https: // nextstrain. org 1 https : // nextstrain . org
10+ > tipB BB: not-a-url 2
11+ > tipC github https: // github. com 3 https : // github . com
12+ > tipD DD <not-a-url > 4
13+ > tipE EE invalid-url 5 invalid-url
14+ > tipF FF 6
1515 > ~~
1616
1717 $ cat > tree . nwk << ~~
@@ -23,14 +23,9 @@ Check that URLs were extracted from metadata values when added as an "extra meta
2323 $ $ {AUGUR} export v2 \
2424 > -- tree tree . nwk \
2525 > -- metadata metadata. tsv \
26- > -- metadata-columns " field_A" \
26+ > -- metadata-columns " field_A" " field_B " \
2727 > -- maintainers " Nextstrain Team" \
28- > -- output dataset. json
29- Validating schema of ' dataset.json' ...
30- Validation of ' dataset.json' succeeded.
31- Validating produced JSON
32- Validating that the JSON is internally consistent...
33-
28+ > -- output dataset. json &> / dev/ null
3429
3530 $ python3 " $ TESTDIR /../../../../scripts/diff_jsons.py" " $ TESTDIR /../data/dataset-with-parsed-urls.json" dataset. json \
3631 > -- exclude-paths " root['meta']['updated']"
@@ -42,15 +37,9 @@ Check that URLs were extracted from metadata values when used as a coloring
4237 $ $ {AUGUR} export v2 \
4338 > -- tree tree . nwk \
4439 > -- metadata metadata. tsv \
45- > -- color-by-metadata " field_A" \
40+ > -- color-by-metadata " field_A" " field_B " \
4641 > -- maintainers " Nextstrain Team" \
47- > -- output dataset2. json
48- Validating schema of ' dataset2.json' ...
49- Validation of ' dataset2.json' succeeded.
50- Trait ' field_A' was guessed as being type ' categorical' . Use a ' config' file if you'd like to set this yourself.
51- Validating produced JSON
52- Validating that the JSON is internally consistent...
53-
42+ > -- output dataset2. json &> / dev/ null
5443
5544 $ python3 " $ TESTDIR /../../../../scripts/diff_jsons.py" " $ TESTDIR /../data/dataset-with-parsed-urls.json" dataset2. json \
5645 > -- exclude-paths " root['meta']['updated']" " root['meta']['colorings']" " root['meta']['filters']"
@@ -62,12 +51,12 @@ The data is essentially the same, but tipB & tipD have empty-string URLs and tip
6251 $ cat > node-data. json << ~~
6352 > {" nodes" :
6453 > {
65- > " tipA" : {" field_A" : " nextstrain" , " field_A__url" : " https://nextstrain.org" },
66- > " tipB" : {" field_A" : " BB: not-a-url" , " field_A__url" : " " },
67- > " tipC" : {" field_A" : " github" , " field_A__url" : " https://github.com" },
68- > " tipD" : {" field_A" : " DD <not-a-url>" , " field_A__url" : " " },
69- > " tipE" : {" field_A" : " EE" , " field_A__url" : " invalid-url" },
70- > " tipF" : {" field_A" : " FF" }
54+ > " tipA" : {" field_A" : " nextstrain" , " field_A__url" : " https://nextstrain.org" , " field_B " : 1 , " field_B__url " : " https://nextstrain.org " },
55+ > " tipB" : {" field_A" : " BB: not-a-url" , " field_A__url" : " " , " field_B " : 2 , " field_B__url " : " " },
56+ > " tipC" : {" field_A" : " github" , " field_A__url" : " https://github.com" , " field_B " : 3 , " field_B__url " : " https://github.com " },
57+ > " tipD" : {" field_A" : " DD <not-a-url>" , " field_A__url" : " " , " field_B " : 4 , " field_B__url " : " " },
58+ > " tipE" : {" field_A" : " EE" , " field_A__url" : " invalid-url" , " field_B " : 5 , " field_B__url " : " invalid-url " },
59+ > " tipF" : {" field_A" : " FF" , " field_B " : 6 }
7160 > }
7261 > }
7362 > ~~
@@ -76,15 +65,8 @@ The data is essentially the same, but tipB & tipD have empty-string URLs and tip
7665 > -- tree tree . nwk \
7766 > -- node-data node-data. json \
7867 > -- maintainers " Nextstrain Team" \
79- > -- output dataset3. json
80- Validating schema of ' dataset3.json' ...
81- Validation of ' dataset3.json' succeeded.
82- Trait ' field_A' was guessed as being type ' categorical' . Use a ' config' file if you'd like to set this yourself.
83- Validating produced JSON
84- Validating that the JSON is internally consistent...
85-
68+ > -- output dataset3. json &> / dev/ null
8669
87-
88- $ python3 " $ TESTDIR /../../../../scripts/diff_jsons.py" " $ TESTDIR /../data/dataset-with-parsed-urls.json" dataset. json \
89- > -- exclude-paths " root['meta']['updated']"
90- {}
70+ $ python3 " $ TESTDIR /../../../../scripts/diff_jsons.py" " $ TESTDIR /../data/dataset-with-parsed-urls.json" dataset3. json \
71+ > -- exclude-paths " root['meta']['updated']" " root['meta']['colorings']" " root['meta']['filters']"
72+ {}
0 commit comments