def test_worldmap_i18n_clear(): set_countries(_COUNTRIES, True) wmap = Worldmap() wmap.add('countries', dict(fr=12)) set_countries({'fr': 'Frankreich'}, clear=True) q = wmap.render_pyquery() assert len(q('.country.color-0')) == 1 assert 'Frankreich' in q('#fr').text()
def test_worldmap_i18n_clear(): set_countries(_COUNTRIES, True) wmap = Worldmap() wmap.add('countries', dict(fr=12)) set_countries({'fr': 'Frankreich'}, clear=True) q = wmap.render_pyquery() assert len( q('.country.color-0') ) == 1 assert 'Frankreich' in q('.country.fr').text()
def test_worldmap(): set_countries(_COUNTRIES, True) datas = {} for i, ctry in enumerate(COUNTRIES): datas[ctry] = i wmap = Worldmap() wmap.add('countries', datas) q = wmap.render_pyquery() assert len(q('.country.color-0')) == len(COUNTRIES) assert 'France' in q('#fr').text()
def test_worldmap(): set_countries(_COUNTRIES, True) datas = {} for i, ctry in enumerate(COUNTRIES): datas[ctry] = i wmap = Worldmap() wmap.add('countries', datas) q = wmap.render_pyquery() assert len( q('.country.color-0') ) == len(COUNTRIES) assert 'France' in q('.country.fr').text()
def test_worldmap(): wmap = Worldmap(style=choice(list(styles.values()))) wmap.add('1st', [('fr', 100), ('us', 10)]) wmap.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) wmap.add('3rd', ['ch', 'cz', 'ca', 'cn']) wmap.add('4th', {'br': 12, 'bo': 1, 'bu': 23, 'fr': 34}) wmap.add('5th', [{ 'value': ('tw', 10), 'label': 'First label', 'xlink': 'http://google.com?q=tw' }, { 'value': ('bw', 20), 'label': 'Second one', 'xlink': 'http://google.com?q=bw' }, { 'value': ('mw', 40), 'label': 'Last' }]) wmap.add('6th', [3, 5, 34, 12]) wmap.title = 'World Map !!' return wmap.render_response()
def test_worldmap(): import random map = Worldmap(style=random.choice(styles.values())) map.add('1st', [('fr', 100), ('us', 10)]) map.add('2nd', [('jp', 1), ('ru', 7), ('uk', 0)]) map.add('3rd', ['ch', 'cz', 'ca', 'cn']) map.add('4th', {'br': 12, 'bo': 1, 'bu': 23, 'fr': 34}) map.add('5th', [{ 'value': ('tw', 10), 'label': 'First label', 'xlink': 'http://google.com?q=tw' }, { 'value': ('bw', 20), 'label': 'Second one', 'xlink': 'http://google.com?q=bw' }, { 'value': ('mw', 40), 'label': 'Last' }]) map.add('6th', [3, 5, 34, 12]) map.title = 'World Map !!' return map.render_response()
def test_worldmap(): wmap = Worldmap(style=choice(list(styles.values()))) wmap.add("1st", [("fr", 100), ("us", 10)]) wmap.add("2nd", [("jp", 1), ("ru", 7), ("uk", 0)]) wmap.add("3rd", ["ch", "cz", "ca", "cn"]) wmap.add("4th", {"br": 12, "bo": 1, "bu": 23, "fr": 34}) wmap.add( "5th", [ {"value": ("tw", 10), "label": "First label", "xlink": "http://google.com?q=tw"}, {"value": ("bw", 20), "label": "Second one", "xlink": "http://google.com?q=bw"}, {"value": ("mw", 40), "label": "Last"}, ], ) wmap.add("6th", [3, 5, 34, 12]) wmap.title = "World Map !!" return wmap.render_response()