Browse Source

Fixes tests on the worldmap

pull/63/head
Jean-Marc Martins 11 years ago
parent
commit
699422c131
  1. 3
      pygal/test/test_graph.py
  2. 1
      pygal/util.py

3
pygal/test/test_graph.py

@ -20,6 +20,7 @@ import os
import pygal
import uuid
import sys
from pygal import i18n
from pygal.util import cut
from pygal._compat import u
from pygal.test import pytest_generate_tests, make_data
@ -69,6 +70,8 @@ def test_metadata(Chart):
v = range(7)
if Chart == pygal.XY:
v = list(map(lambda x: (x, x + 1), v))
elif Chart == pygal.Worldmap:
v = list(map(lambda x: x, i18n.COUNTRIES))
chart.add('Serie with metadata', [
v[0],

1
pygal/util.py

@ -346,6 +346,7 @@ def prepare_values(raw, config, cls):
(width - len(raw_values)) * [None] # aligning values
if len(raw_values) < width else [])):
if isinstance(raw_value, dict):
raw_value = dict(raw_value)
value = raw_value.pop('value', None)
metadata[index] = raw_value
else:

Loading…
Cancel
Save