Skip to content

Commit e36150d

Browse files
committed
Adding tests for line
1 parent 16e4234 commit e36150d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/folium_tests.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,30 @@ def test_create_map(self):
417417
# Test write
418418
map.create_map()
419419

420+
def test_line(self):
421+
'''Test multi_polyline'''
422+
423+
line_temp = self.env.get_template('polyline.js')
424+
425+
line_opts = {
426+
'color': 'blue',
427+
'weight': 2,
428+
'opacity': 1
429+
}
430+
locations = [
431+
[[45.5236, -122.6750], [45.5236, -122.6751]],
432+
[[45.5237, -122.6750], [45.5237, -122.6751]],
433+
[[45.5238, -122.6750], [45.5238, -122.6751]]
434+
]
435+
line_rendered = line_temp.render({'line': 'line_1',
436+
'locations': locations, 'options': line_opts})
437+
438+
self.map.line(locations=locations,
439+
line_color=line_opts['color'],
440+
line_weight=line_opts['weight'],
441+
line_opacity=line_opts['opacity'])
442+
assert self.map.template_vars['lines'][0][0] == line_rendered
443+
420444
def test_multi_polyline(self):
421445
'''Test multi_polyline'''
422446

0 commit comments

Comments
 (0)