#NEWLINE# def test_copy_rgb( tmpdir ) : #NEWLINE# #INDENT# outfile = str ( tmpdir . join ( 'out.tif' ) ) #NEWLINE# runner = CliRunner ( ) #NEWLINE# result = runner . invoke ( calc , [ '(read 1)' , 'tests/data/RGB.byte.tif' , outfile ] , catch_exceptions = False ) #NEWLINE# assert ( result . exit_code == 0 ) #NEWLINE# with rasterio . open ( outfile ) as src : #NEWLINE# #INDENT# assert ( src . count == 3 ) #NEWLINE# assert ( src . meta [ 'dtype' ] == 'uint8' ) #NEWLINE# data = src . read ( masked = True ) #NEWLINE# assert ( round ( data . mean ( ) , 1 ) == 60.6 )