From 48b1460688b7adbac0979a70339ba3ee841e2abd Mon Sep 17 00:00:00 2001 From: snowman2 Date: Wed, 8 Jun 2022 20:51:30 -0500 Subject: [PATCH] TST: test_coordinate_operation_grids__alternative_grid_name fixed to network full_name behavior --- test/conftest.py | 2 +- test/crs/test_crs.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index b6cb13083..716ee81aa 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -66,7 +66,7 @@ def grids_available(*grid_names, check_network=True, check_all=False): """ Check if the grids are available """ - if check_network and os.environ.get("PROJ_NETWORK") == "ON": + if check_network and pyproj.network.is_network_enabled(): return True available = [ ( diff --git a/test/crs/test_crs.py b/test/crs/test_crs.py index 27d39265c..7e58a5b86 100644 --- a/test/crs/test_crs.py +++ b/test/crs/test_crs.py @@ -611,12 +611,12 @@ def test_coordinate_operation_grids__alternative_grid_name(): assert grid.direct_download is True assert grid.open_license is True assert grid.short_name == "ca_nrc_ntv1_can.tif" - if grids_available(grid.short_name): + if PROJ_GTE_91 and pyproj.network.is_network_enabled(): assert grid.available is True - if PROJ_GTE_91: - assert grid.full_name == "" - else: - assert grid.full_name.endswith(grid.short_name) + assert grid.full_name == "" + elif grids_available(grid.short_name): + assert grid.available is True + assert grid.full_name.endswith(grid.short_name) else: assert grid.available is False assert grid.full_name == ""