Skip to content

Commit

Permalink
Add tests that fails referencing #188
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Feb 13, 2015
1 parent 14ef658 commit a1acaac
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions demo/moulinrouge/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from pygal.colors import rotate
from pygal.graph.frenchmap import DEPARTMENTS, REGIONS
from random import randint, choice
from datetime import datetime


def get_test_routes(app):
Expand Down Expand Up @@ -218,6 +219,12 @@ def test_no_data_for(chart):
graph.title = '123456789 ' * 30
return graph.render_response()

@app.route('/test/datey_single')
def test_datey_single():
graph = DateY(interpolate='cubic')
graph.add('Single', [(datetime.now(), 1)])
return graph.render_response()

@app.route('/test/no_data/at_all/<chart>')
def test_no_data_at_all_for(chart):
graph = CHARTS_BY_NAME[chart]()
Expand Down
25 changes: 25 additions & 0 deletions pygal/test/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,31 @@ def test_empty_lists_with_nones(Chart):
q = chart.render_pyquery()
assert len(q(".legend")) == 2


def test_only_one_value(Chart):
chart = Chart()
chart.add('S', [1])
chart.x_labels = ('single')
q = chart.render_pyquery()
assert len(q(".legend")) == 1


def test_only_one_value_log(Chart):
chart = Chart(logarithmic=True)
chart.add('S', [1])
chart.x_labels = ('single')
q = chart.render_pyquery()
assert len(q(".legend")) == 1


def test_only_one_value_intrp(Chart):
chart = Chart(interpolate='cubic')
chart.add('S', [1])
chart.x_labels = ('single')
q = chart.render_pyquery()
assert len(q(".legend")) == 1


def test_non_iterable_value(Chart):
chart = Chart(no_prefix=True)
chart.add('A', 1)
Expand Down

0 comments on commit a1acaac

Please sign in to comment.