Fix uuid4 test failure with latest branca
Fix tests in folium after merging in branca
@@ -21,11 +21,6 @@ import pandas as pd
import pytest
-try:
- from unittest import mock
-except ImportError:
- import mock
-
rootpath = os.path.abspath(os.path.dirname(__file__))
@@ -74,8 +69,6 @@ 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],
@@ -91,7 +84,7 @@ class TestFolium(object):
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
@@ -105,11 +98,11 @@ class TestFolium(object):
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': {}
}
}
