#NEWLINE# def test_singleband_calc_byindex( tmpdir ) : #NEWLINE# #INDENT# outfile = str ( tmpdir . join ( 'out.tif' ) ) #NEWLINE# runner = CliRunner ( ) #NEWLINE# result = runner . invoke ( calc , [ '(+ 125 (* 0.1 (read 1 1)))' , 'tests/data/shade.tif' , outfile ] , catch_exceptions = False ) #NEWLINE# assert ( result . exit_code == 0 ) #NEWLINE# with rasterio . open ( outfile ) as src : #NEWLINE# #INDENT# assert ( src . count == 1 ) #NEWLINE# assert ( src . meta [ 'dtype' ] == 'uint8' ) #NEWLINE# data = src . read ( masked = True ) #NEWLINE# assert ( data . min ( ) == 125 )