Skip to content

Commit

Permalink
use TempFixture for rasterband get_statistics test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBeilschmidt committed Sep 2, 2022
1 parent cb5cf9f commit 499cac4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/raster/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::raster::rasterband::ResampleAlg;
use crate::raster::{
ByteBuffer, ColorInterpretation, RasterCreationOption, StatisticsAll, StatisticsMinMax,
};
use crate::test_utils::TempFixture;
use crate::vsi::unlink_mem_file;
use crate::Driver;
use gdal_sys::GDALDataType;
Expand Down Expand Up @@ -806,7 +807,9 @@ fn test_color_table() {

#[test]
fn test_raster_stats() {
let dataset = Dataset::open(fixture!("tinymarble.tif")).unwrap();
let fixture = TempFixture::fixture("tinymarble.tif");

let dataset = Dataset::open(&fixture).unwrap();
let rb = dataset.rasterband(1).unwrap();

assert!(rb.get_statistics(false, false).unwrap().is_none());
Expand All @@ -828,8 +831,4 @@ fn test_raster_stats() {
max: 255.0,
}
);

// clean up aux file
drop(dataset);
std::fs::remove_file(fixture!("tinymarble.tif.aux.xml")).unwrap();
}

0 comments on commit 499cac4

Please sign in to comment.