File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-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
+ kw = dict (id = popup .html ._children .items ()[0 ][0 ],
21
+ width = '100.0%' ,
22
+ height = '100.0%' ,
23
+ text = 'Some text.' )
24
+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
25
+
26
+
27
+ def test_popup_quotes ():
28
+ popup = Popup ("Let's try quotes" )
29
+ kw = dict (id = popup .html ._children .items ()[0 ][0 ],
30
+ width = '100.0%' ,
31
+ height = '100.0%' ,
32
+ text = 'Let's try quotes' )
33
+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
34
+
35
+
36
+ def test_popup_unicode ():
37
+ popup = Popup ("Ça c'est chouette" )
38
+ kw = dict (id = popup .html ._children .items ()[0 ][0 ],
39
+ width = '100.0%' ,
40
+ height = '100.0%' ,
41
+ text = "Ça c'est chouette" )
42
+ assert popup .html .render ().strip () == tmpl (** kw ).strip ()
You can’t perform that action at this time.
0 commit comments