Skip to content

Commit

Permalink
TST: Add assert statements at the end of tests (#1453)
Browse files Browse the repository at this point in the history
* Add assert statements at the end of tests

* Fix failed tests
  • Loading branch information
tqa236 authored Oct 24, 2024
1 parent 866a63f commit 2fbca30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions test/crs/test_crs_cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down
22 changes: 11 additions & 11 deletions test/crs/test_crs_coordinate_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 2fbca30

Please sign in to comment.