def test_ints(self): assert api._parse_nodata_value("-9999") == -9999 assert api._parse_nodata_value("0") == 0 assert api._parse_nodata_value("1") == 1
def test_nan(self): for x in ["NaN", "nan"]: assert math.isnan(api._parse_nodata_value(x))
def test_default_value(self): assert api._parse_nodata_value(None) == api._parse_nodata_value( api.DEFAULT_NODATA_VALUE)
def test_null(self): assert api._parse_nodata_value("null") is None
def test_non_numeric(self): with pytest.raises(api.ClientError): api._parse_nodata_value("Non numeric string")