Skip to content

Commit

Permalink
tests: assert bounds within reasonable machine precision (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnavigator authored Jan 4, 2021
1 parent 04d8a6d commit fb5876f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions tests/plugins/test_heat_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ def test_heat_map():
assert tmpl.render(this=hm)

bounds = m.get_bounds()
assert bounds == [[46.218566840847025, 3.0302801394447734],
[50.75345011431167, 7.132453997672826]], bounds
np.testing.assert_allclose(
bounds,
[[46.218566840847025, 3.0302801394447734],
[50.75345011431167, 7.132453997672826]])


def test_heatmap_data():
Expand Down
6 changes: 4 additions & 2 deletions tests/plugins/test_marker_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ def test_marker_cluster():
assert expected in out

bounds = m.get_bounds()
assert bounds == [[35.147332572663785, -11.520684337300109],
[59.839718052359274, 29.94931046497927]], bounds
np.testing.assert_allclose(
bounds,
[[35.147332572663785, -11.520684337300109],
[59.839718052359274, 29.94931046497927]])
4 changes: 3 additions & 1 deletion tests/test_folium.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,6 @@ def test_json_request(self):

self.m._parent.render()
bounds = self.m.get_bounds()
assert bounds == [[18.948267, -178.123152], [71.351633, 173.304726]], bounds # noqa
np.testing.assert_allclose(
bounds,
[[18.948267, -178.123152], [71.351633, 173.304726]])

0 comments on commit fb5876f

Please sign in to comment.