-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
test_map.py
47 lines (36 loc) · 1.16 KB
/
test_map.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""
Folium map Tests
----------------
"""
from __future__ import unicode_literals
from folium.map import Popup # TODO: Map, Marker, ...
tmpl = """
<div id="{id}"
style="width: {width}; height: {height};">
{text}</div>
""".format
def test_popup_ascii():
popup = Popup('Some text.')
_id = list(popup.html._children.keys())[0]
kw = dict(id=_id,
width='100.0%',
height='100.0%',
text='Some text.')
assert popup.html.render().strip() == tmpl(**kw).strip()
def test_popup_quotes():
popup = Popup("Let's try quotes")
_id = list(popup.html._children.keys())[0]
kw = dict(id=_id,
width='100.0%',
height='100.0%',
text='Let's try quotes')
assert popup.html.render().strip() == tmpl(**kw).strip()
def test_popup_unicode():
popup = Popup("Ça c'est chouette")
_id = list(popup.html._children.keys())[0]
kw = dict(id=_id,
width='100.0%',
height='100.0%',
text="Ça c'est chouette")
assert popup.html.render().strip() == tmpl(**kw).strip()