def get_valid_epsgs() -> Set[str]: """Retruns a Set of valid and not deprecated EPSG codes Returns ------- Set[str] The valid EPSG codes """ valid_epsgs = {"CRS:84"} for pj_type in PJType: valid_epsgs.update( map( lambda x: f"EPSG:{x}", get_codes("EPSG", pj_type, allow_deprecated=False), )) return valid_epsgs
def test_get_codes(auth, pj_type, deprecated): assert get_codes(auth, pj_type, deprecated)
def test_get_codes__invalid_code(): with pytest.raises(ValueError): get_codes("ITRF", "frank")
def test_get_codes__invalid_auth(): with pytest.raises(TypeError): get_codes(123, PJType.BOUND_CRS)
def test_get_codes__empty(auth, pj_type): assert not get_codes(auth, pj_type)