#NEWLINE# def test_sieve_band( pixelated_image , pixelated_image_file ) : #NEWLINE# #INDENT# ' Sieving a band from a raster file should match sieve of array ' #NEWLINE# with Env ( ) : #NEWLINE# #INDENT# truth = sieve ( pixelated_image , 9 ) #NEWLINE# with rasterio . open ( pixelated_image_file ) as src : #NEWLINE# #INDENT# band = rasterio . band ( src , 1 ) #NEWLINE# assert numpy . array_equal ( src , sieve ( band , 9 ) ) #NEWLINE# assert numpy . array_equal ( pixelated_image , sieve ( band , 9 , mask = band ) )