|
34 | 34 | rootpath = os.path.abspath(os.path.dirname(__file__))
|
35 | 35 |
|
36 | 36 | # For testing remote requests
|
37 |
| -remote_url = '/'.join([ |
38 |
| - 'https://raw.githubusercontent.com', |
39 |
| - 'python-visualization/folium/master', |
40 |
| - 'examples/data/us-states.json']) |
| 37 | +remote_url = 'https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json' # noqa |
41 | 38 |
|
42 | 39 |
|
43 | 40 | def setup_data():
|
44 | 41 | """Import economic data for testing."""
|
45 |
| - with open(os.path.join(rootpath, 'us-counties.json'), 'r') as f: |
| 42 | + with open(os.path.join(rootpath, 'us-counties.json')) as f: |
46 | 43 | get_id = json.load(f)
|
47 | 44 |
|
48 | 45 | county_codes = [x['id'] for x in get_id['features']]
|
@@ -162,7 +159,6 @@ def test_custom_tile(self):
|
162 | 159 | bounds = m.get_bounds()
|
163 | 160 | assert bounds == [[None, None], [None, None]], bounds
|
164 | 161 |
|
165 |
| - |
166 | 162 | def test_feature_group(self):
|
167 | 163 | """Test FeatureGroup."""
|
168 | 164 |
|
@@ -236,7 +232,7 @@ def test_map_build(self):
|
236 | 232 | def test_tile_attr_unicode(self):
|
237 | 233 | """Test tile attribution unicode
|
238 | 234 |
|
239 |
| - Test not cover b'юникод' |
| 235 | + Test does not cover b'юникод' |
240 | 236 | because for python 3 bytes can only contain ASCII literal characters.
|
241 | 237 | """
|
242 | 238 |
|
@@ -315,24 +311,24 @@ def test_custom_icon(self):
|
315 | 311 |
|
316 | 312 | def test_global_switches(self):
|
317 | 313 | m = folium.Map(prefer_canvas=True)
|
318 |
| - assert (m.global_switches.prefer_canvas is True and |
319 |
| - m.global_switches.no_touch is False and |
320 |
| - m.global_switches.disable_3d is False) |
| 314 | + assert m.global_switches.prefer_canvas |
| 315 | + assert not m.global_switches.no_touch |
| 316 | + assert not m.global_switches.disable_3d |
321 | 317 |
|
322 | 318 | m = folium.Map(no_touch=True)
|
323 |
| - assert (m.global_switches.prefer_canvas is False and |
324 |
| - m.global_switches.no_touch is True and |
325 |
| - m.global_switches.disable_3d is False) |
| 319 | + assert not m.global_switches.prefer_canvas |
| 320 | + assert m.global_switches.no_touch |
| 321 | + assert not m.global_switches.disable_3d |
326 | 322 |
|
327 | 323 | m = folium.Map(disable_3d=True)
|
328 |
| - assert (m.global_switches.prefer_canvas is False and |
329 |
| - m.global_switches.no_touch is False and |
330 |
| - m.global_switches.disable_3d is True) |
| 324 | + assert not m.global_switches.prefer_canvas |
| 325 | + assert not m.global_switches.no_touch |
| 326 | + assert m.global_switches.disable_3d |
331 | 327 |
|
332 | 328 | m = folium.Map(prefer_canvas=True, no_touch=True, disable_3d=True)
|
333 |
| - assert (m.global_switches.prefer_canvas is True and |
334 |
| - m.global_switches.no_touch is True and |
335 |
| - m.global_switches.disable_3d is True) |
| 329 | + assert m.global_switches.prefer_canvas |
| 330 | + assert m.global_switches.no_touch |
| 331 | + assert m.global_switches.disable_3d |
336 | 332 |
|
337 | 333 | @pytest.mark.web
|
338 | 334 | def test_json_request(self):
|
|
0 commit comments