Skip to content

Commit

Permalink
Fix preliminary JSON testing code
Browse files Browse the repository at this point in the history
Now it actually works! And checks a few tiny JSON things.

Tomorrow I'll start expanding this to cover more of the old
functionality for checking JSON files (but this time, against an
ordination file instead of against a beta.csv file).

Ideally we should be able to get our testing_utilities.py "library"
to a point where we can just drop in arbitrary ordination/beta.csv
files here and have the test validate them. This'll make testing rrv
a lot easier.
  • Loading branch information
fedarko committed Feb 20, 2019
1 parent 41039b4 commit 17dcea9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rankratioviz/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import os
from click.testing import CliRunner
# from rankratioviz import generate
Expand Down Expand Up @@ -26,6 +27,6 @@ def test_basic():
# TODO: make validate_rank_plot_json() work with arbitrary data, and also
# with DEICODE ordination files (probs best practice to just add a
# parameter that changes behavior re: songbird/DEICODE input)
with open(os.path.join("out_dir", "rank_plot.json"), 'r') as rplot_json:
with open(os.path.join(out_dir, "rank_plot.json"), 'r') as rplot_json:
rplot = json.load(rplot_json)
testing_utilities.basic_vegalite_json_validation(rplot)

0 comments on commit 17dcea9

Please sign in to comment.