Skip to content

Commit c67a2fa

Browse files
committed
Récupération de la correction de tests unitaires (comparaison flottante)
2 parents 36932ac + 77fb4ae commit c67a2fa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_Utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import pytest
55
import os
6+
import math
67

78
from unittest.mock import *
89
from unittest import mock
@@ -52,7 +53,10 @@ def test_reproject_point_ok():
5253
sr_3857 = srs_to_spatialreference("EPSG:3857")
5354
sr_ignf = srs_to_spatialreference("IGNF:WGS84G")
5455
x,y = reproject_point((43, 3), sr_4326, sr_3857)
55-
assert (x,y) == (333958.4723798207, 5311971.846945471)
56+
57+
assert math.isclose(x, 333958.4723798207, rel_tol=1e-5)
58+
assert math.isclose(y, 5311971.846945471, rel_tol=1e-5)
59+
5660
x,y = reproject_point((43, 3), sr_4326, sr_ignf)
5761
assert (x,y) == (3, 43)
5862

0 commit comments

Comments
 (0)