Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test failures with latest branca #1556

Merged
merged 1 commit into from
Jan 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions tests/test_folium.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@

import pytest

try:
from unittest import mock
except ImportError:
import mock


rootpath = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -76,24 +71,22 @@ class TestFolium(object):

def setup(self):
"""Setup Folium Map."""
with mock.patch('branca.element.uuid4') as uuid4:
uuid4().hex = '0' * 32
attr = 'http://openstreetmap.org'
self.m = folium.Map(
location=[45.5236, -122.6750],
width=900,
height=400,
max_zoom=20,
zoom_start=4,
max_bounds=True,
attr=attr
)
attr = 'http://openstreetmap.org'
self.m = folium.Map(
location=[45.5236, -122.6750],
width=900,
height=400,
max_zoom=20,
zoom_start=4,
max_bounds=True,
attr=attr
)
self.env = Environment(loader=PackageLoader('folium', 'templates'))

def test_init(self):
"""Test map initialization."""

assert self.m.get_name() == 'map_00000000000000000000000000000000'
assert self.m.get_name().startswith('map_')
assert self.m.get_root() == self.m._parent
assert self.m.location == [45.5236, -122.6750]
assert self.m.options['zoom'] == 4
Expand All @@ -107,11 +100,11 @@ def test_init(self):
assert self.m.global_switches.disable_3d is False
assert self.m.to_dict() == {
'name': 'Map',
'id': '00000000000000000000000000000000',
'id': self.m._id,
'children': {
'openstreetmap': {
'name': 'TileLayer',
'id': '00000000000000000000000000000000',
'id': self.m._children["openstreetmap"]._id,
'children': {}
}
}
Expand Down