projects
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65a9d5d
)
Verify generated visualizations are valid JSONs.
author
drebs
<drebs@riseup.net>
Tue, 18 Apr 2017 14:57:12 +0000
(16:57 +0200)
committer
drebs
<drebs@riseup.net>
Tue, 18 Apr 2017 14:57:12 +0000
(16:57 +0200)
elastic/generate-config.py
patch
|
blob
|
history
diff --git
a/elastic/generate-config.py
b/elastic/generate-config.py
index
abb8d7c
..
9d5358c
100755
(executable)
--- a/
elastic/generate-config.py
+++ b/
elastic/generate-config.py
@@
-23,6
+23,13
@@
def generate_visualizations():
rendered = pystache.render(template, context)
+ # verify we generated valid JSON visualizations
+ content = json.loads(rendered)
+ visState = content['visState']
+ searchSourceJSON = content['kibanaSavedObjectMeta']['searchSourceJSON']
+ assert json.loads(visState)
+ assert json.loads(searchSourceJSON)
+
out = open(out_file, 'w')
out.write(rendered)
out.flush()