#NEWLINE# def test_uint16_data( self ) : #NEWLINE# #INDENT# checksums = [ ( 'aDcXaCcXaCcXaCcX' , '0' ) , ( 'oYiGqXi9oXiEoXi9' , '1746888714' ) , ( 'VhqQWZoQVfoQVZoQ' , '0' ) , ( '4cPp5aOn4aOn4aOn' , '0' ) , ( '8aCN8X9N8aAN8W9N' , '1756785133' ) , ( 'UhqdUZnbUfnbUZnb' , '0' ) , ( '4cQJ5aN94aNG4aN9' , '0' ) ] #NEWLINE# with fits . open ( self . data ( 'o4sp040b0_raw.fits' ) , uint = True ) as hdul : #NEWLINE# #INDENT# hdul . writeto ( self . temp ( 'tmp.fits' ) , clobber = True , checksum = True ) #NEWLINE# with fits . open ( self . temp ( 'tmp.fits' ) , uint = True , checksum = True ) as hdul1 : #NEWLINE# #INDENT# for ( idx , ( hdu_a , hdu_b ) ) in enumerate ( zip ( hdul , hdul1 ) ) : #NEWLINE# #INDENT# if ( ( hdu_a . data is None ) or ( hdu_b . data is None ) ) : #NEWLINE# #INDENT# assert ( hdu_a . data is hdu_b . data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( hdu_a . data == hdu_b . data ) . all ( ) #NEWLINE# #UNINDENT# assert ( 'CHECKSUM' in hdul [ idx ] . header ) #NEWLINE# assert ( hdul [ idx ] . header [ 'CHECKSUM' ] == checksums [ idx ] [ 0 ] ) #NEWLINE# assert ( 'DATASUM' in hdul [ idx ] . header ) #NEWLINE# assert ( hdul [ idx ] . header [ 'DATASUM' ] == checksums [ idx ] [ 1 ] )