From 2fbca3040f26bf8cc3b539c05f8086a2a47cc58c Mon Sep 17 00:00:00 2001 From: Trinh Quoc Anh Date: Thu, 24 Oct 2024 21:49:14 +0200 Subject: [PATCH] TST: Add assert statements at the end of tests (#1453) * Add assert statements at the end of tests * Fix failed tests --- test/crs/test_crs_cf.py | 12 ++++++------ test/crs/test_crs_coordinate_system.py | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/crs/test_crs_cf.py b/test/crs/test_crs_cf.py index 9fa0b3ae5..68f62eb48 100644 --- a/test/crs/test_crs_cf.py +++ b/test/crs/test_crs_cf.py @@ -1864,16 +1864,16 @@ def test_export_compound_crs_cs(): def test_ellipsoidal_cs__geodetic(): crs = CRS.from_epsg(4326) - crs.cs_to_cf() == [ + assert crs.cs_to_cf() == [ { "standard_name": "latitude", - "long_name": "geodetic latitude coordinate", + "long_name": "latitude coordinate", "units": "degrees_north", "axis": "Y", }, { "standard_name": "longitude", - "long_name": "geodetic longitude coordinate", + "long_name": "longitude coordinate", "units": "degrees_east", "axis": "X", }, @@ -1935,16 +1935,16 @@ def test_3d_ellipsoidal_cs_depth(): }, } ) - crs.cs_to_cf() == [ + assert crs.cs_to_cf() == [ { "standard_name": "latitude", - "long_name": "geodetic latitude coordinate", + "long_name": "latitude coordinate", "units": "degrees_north", "axis": "Y", }, { "standard_name": "longitude", - "long_name": "geodetic longitude coordinate", + "long_name": "longitude coordinate", "units": "degrees_east", "axis": "X", }, diff --git a/test/crs/test_crs_coordinate_system.py b/test/crs/test_crs_coordinate_system.py index 14d4e41d7..b926cf222 100644 --- a/test/crs/test_crs_coordinate_system.py +++ b/test/crs/test_crs_coordinate_system.py @@ -210,7 +210,7 @@ def test_ellipsoidal3dcs_to_cf(): def test_cartesian2dcs_ft_to_cf(): csft = Cartesian2DCS(axis=Cartesian2DCSAxis.NORTHING_EASTING_FT) - csft.to_cf() == [ + assert csft.to_cf() == [ { "axis": "Y", "long_name": "Northing", @@ -228,25 +228,25 @@ def test_cartesian2dcs_ft_to_cf(): def test_cartesian2dcs_to_cf(): csm = Cartesian2DCS(axis=Cartesian2DCSAxis.EASTING_NORTHING_FT) - csm.to_cf() == [ - { - "axis": "Y", - "long_name": "Northing", - "standard_name": "projection_y_coordinate", - "units": "metre", - }, + assert csm.to_cf() == [ { "axis": "X", "long_name": "Easting", "standard_name": "projection_x_coordinate", - "units": "metre", + "units": "0.3048 metre", + }, + { + "axis": "Y", + "long_name": "Northing", + "standard_name": "projection_y_coordinate", + "units": "0.3048 metre", }, ] def test_verticalcs_depth_to_cf(): vcs = VerticalCS(axis=VerticalCSAxis.DEPTH) - vcs.to_cf() == [ + assert vcs.to_cf() == [ { "standard_name": "height_above_reference_ellipsoid", "long_name": "Depth", @@ -259,7 +259,7 @@ def test_verticalcs_depth_to_cf(): def test_verticalcs_height_to_cf(): vcs = VerticalCS(axis=VerticalCSAxis.GRAVITY_HEIGHT_US_FT) - vcs.to_cf() == [ + assert vcs.to_cf() == [ { "standard_name": "height_above_reference_ellipsoid", "long_name": "Gravity-related height",