|
13 | 13 |
|
14 | 14 | from eoreader import utils |
15 | 15 | from eoreader.bands import ( |
| 16 | + AFRI_1_6, |
16 | 17 | BLUE, |
17 | 18 | CA, |
18 | 19 | CLOUDS, |
19 | 20 | DEM, |
20 | 21 | GREEN, |
| 22 | + GREEN1, |
21 | 23 | HH, |
22 | 24 | HILLSHADE, |
23 | 25 | HV, |
@@ -419,3 +421,33 @@ def test_windowed_reading(): |
419 | 421 | # The arrays shouldn't be equal (some cleaning is done) |
420 | 422 | with pytest.raises(AssertionError): |
421 | 423 | np.testing.assert_array_equal(red_raw.data, red_clean.data) |
| 424 | + |
| 425 | + |
| 426 | +def test_deprecation(): |
| 427 | + """Test deprecation warning""" |
| 428 | + |
| 429 | + opt_stack = others_path() / "20200310T030415_WV02_Ortho_BGRN_STK.tif" |
| 430 | + prod_green1 = READER.open( |
| 431 | + opt_stack, |
| 432 | + custom=True, |
| 433 | + sensor_type=SensorType.OPTICAL, |
| 434 | + pixel_size=2.0, |
| 435 | + band_map={GREEN1: 1, RED: 2, BLUE: 3, NIR: 4, SWIR_1: 5}, |
| 436 | + ) |
| 437 | + window = Window(200, 500, 200, 500) |
| 438 | + |
| 439 | + # Check deprecation for GREEN1 |
| 440 | + with pytest.deprecated_call(): |
| 441 | + to_band("GREEN1") |
| 442 | + with pytest.deprecated_call(): |
| 443 | + prod_green1.load("GREEN1", window=window) |
| 444 | + with pytest.deprecated_call(): |
| 445 | + prod_green1.load(GREEN1, window=window) |
| 446 | + |
| 447 | + # Check deprecation for deprecated spectral indices |
| 448 | + with pytest.deprecated_call(): |
| 449 | + prod_green1.load(AFRI_1_6, window=window) |
| 450 | + |
| 451 | + # Check deprecation for resolution keyword |
| 452 | + with pytest.deprecated_call(): |
| 453 | + prod_green1.load(SWIR_1, resolution=2.0, window=window) |
0 commit comments