File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed 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 folium .map import Popup # TODO: Map, Marker, ...
9
+
10
+
11
+ tmpl = """
12
+ <div id="{id}"
13
+ style="width: {width}; height: {height};">
14
+ {text}</div>
15
+ """ .format
16
+
17
+
18
+ def test_popup_ascii ():
19
+ popup = Popup ('Some text.' )
20
+ _id = list (popup .html ._children .items ())[0 ][0 ]
21
+ kw = dict (id = _id ,
22
+ width = '100.0%' ,
23
+ height = '100.0%' ,
24
+ text = 'Some text.' )
25
+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
26
+
27
+
28
+ def test_popup_quotes ():
29
+ popup = Popup ("Let's try quotes" )
30
+ _id = list (popup .html ._children .items ())[0 ][0 ]
31
+ kw = dict (id = _id ,
32
+ width = '100.0%' ,
33
+ height = '100.0%' ,
34
+ text = 'Let's try quotes' )
35
+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
36
+
37
+
38
+ def test_popup_unicode ():
39
+ popup = Popup ("Ça c'est chouette" )
40
+ _id = list (popup .html ._children .items ())[0 ][0 ]
41
+ kw = dict (id = _id ,
42
+ width = '100.0%' ,
43
+ height = '100.0%' ,
44
+ text = "Ça c'est chouette" )
45
+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
You can’t perform that action at this time.
0 commit comments