Skip to content

Commit 1069f05

Browse files
committed
test before render
1 parent 54e692c commit 1069f05

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ clean:
1111
rm -f *.pyc
1212
rm -f .Rhistory
1313

14-
travis: render
14+
travis: test render
1515
echo "Done"
1616

17+
test:
18+
python -m pytest tests/
19+
1720
qrender:
1821
python render.py "Examples.ipynb"
1922

tests/test_plots.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import render
2+
3+
defined_plots = {'bar-counts': ['pandas', 'plotnine', 'ggplot'],
4+
'dodged-bar-chart': ['pandas', 'plotnine', 'ggplot'],
5+
'scatter-plot': ['pandas', 'plotnine', 'ggplot'],
6+
'scatter-plot-with-colors': ['matplotlib',
7+
'seaborn',
8+
'plotnine',
9+
'ggplot'],
10+
'scatter-plot-with-facet': ['seaborn', 'plotnine', 'ggplot'],
11+
'scatter-plot-with-facets': ['seaborn', 'plotnine', 'ggplot'],
12+
'scatter-plot-with-size': ['pandas', 'plotnine', 'ggplot'],
13+
'scatter-with-regression': ['seaborn', 'plotnine', 'ggplot'],
14+
'simple-histogram': ['pandas', 'matplotlib', 'plotnine', 'ggplot', 'bokeh'],
15+
'stacked-bar-chart': ['pandas', 'plotnine', 'ggplot'],
16+
'stacked-kde': ['pandas', 'seaborn', 'plotnine', 'ggplot'],
17+
'stacked-smooth-line-and-scatter': ['plotnine', 'ggplot'],
18+
'timeseries': ['pandas', 'plotnine', 'ggplot']}
19+
20+
21+
def test_exist():
22+
plots = render.extract_cells("Examples.ipynb")
23+
for name, slug in plots:
24+
names = [d['package-slug'] for d in plots[(name, slug)]]
25+
assert set(names) == set(defined_plots[slug])

0 commit comments

Comments
 (0)