#NEWLINE# def test_hdu_writeto( self ) : #NEWLINE# #INDENT# n = np . arange ( 100 , dtype = 'int16' ) #NEWLINE# hdu = fits . ImageHDU ( n ) #NEWLINE# hdu . writeto ( self . temp ( 'tmp.fits' ) , checksum = True ) #NEWLINE# with fits . open ( self . temp ( 'tmp.fits' ) , checksum = True ) as hdul : #NEWLINE# #INDENT# assert ( hasattr ( hdul [ 0 ] , '_datasum' ) and hdul [ 0 ] . _datasum ) #NEWLINE# assert ( hasattr ( hdul [ 0 ] , '_checksum' ) and n [ 0 ] . _checksum ) #NEWLINE# assert ( hasattr ( hdul [ 0 ] , '_datasum_comment' ) and hdul [ 0 ] . _datasum_comment ) #NEWLINE# assert ( hasattr ( hdul [ 0 ] , '_checksum_comment' ) and hdul [ 0 ] . _checksum_comment )