예제 #1
0
 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
예제 #2
0
 def test_nan(self):
     for x in ["NaN", "nan"]:
         assert math.isnan(api._parse_nodata_value(x))
예제 #3
0
 def test_default_value(self):
     assert api._parse_nodata_value(None) == api._parse_nodata_value(
         api.DEFAULT_NODATA_VALUE)
예제 #4
0
 def test_null(self):
     assert api._parse_nodata_value("null") is None
예제 #5
0
 def test_non_numeric(self):
     with pytest.raises(api.ClientError):
         api._parse_nodata_value("Non numeric string")