Skip to content

Commit

Permalink
Récupération de la correction de tests unitaires (comparaison flottante)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolite committed Mar 20, 2023
2 parents 36932ac + 77fb4ae commit c67a2fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pytest
import os
import math

from unittest.mock import *
from unittest import mock
Expand Down Expand Up @@ -52,7 +53,10 @@ def test_reproject_point_ok():
sr_3857 = srs_to_spatialreference("EPSG:3857")
sr_ignf = srs_to_spatialreference("IGNF:WGS84G")
x,y = reproject_point((43, 3), sr_4326, sr_3857)
assert (x,y) == (333958.4723798207, 5311971.846945471)

assert math.isclose(x, 333958.4723798207, rel_tol=1e-5)
assert math.isclose(y, 5311971.846945471, rel_tol=1e-5)

x,y = reproject_point((43, 3), sr_4326, sr_ignf)
assert (x,y) == (3, 43)

Expand Down

0 comments on commit c67a2fa

Please sign in to comment.