File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66Classes for drawing maps.
77"""
8+
9+ from __future__ import unicode_literals
10+
811import warnings
912import json
1013from collections import OrderedDict
Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+
3+ """
4+ Folium map Tests
5+ ----------------
6+
7+ """
8+ from __future__ import unicode_literals
9+
10+ from folium .map import Popup # TODO: Map, Marker, ...
11+
12+
13+ tmpl = """
14+ <div id="{id}"
15+ style="width: {width}; height: {height};">
16+ {text}</div>
17+ """ .format
18+
19+
20+ def test_popup_ascii ():
21+ popup = Popup ('Some text.' )
22+ _id = list (popup .html ._children .keys ())[0 ]
23+ kw = dict (id = _id ,
24+ width = '100.0%' ,
25+ height = '100.0%' ,
26+ text = 'Some text.' )
27+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
28+
29+
30+ def test_popup_quotes ():
31+ popup = Popup ("Let's try quotes" )
32+ _id = list (popup .html ._children .keys ())[0 ]
33+ kw = dict (id = _id ,
34+ width = '100.0%' ,
35+ height = '100.0%' ,
36+ text = 'Let's try quotes' )
37+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
38+
39+
40+ def test_popup_unicode ():
41+ popup = Popup ("Ça c'est chouette" )
42+ _id = list (popup .html ._children .keys ())[0 ]
43+ kw = dict (id = _id ,
44+ width = '100.0%' ,
45+ height = '100.0%' ,
46+ text = "Ça c'est chouette" )
47+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
You can’t perform that action at this time.
0 commit comments