#NEWLINE# def test_streaming_hdu_write_file( self ) : #NEWLINE# #INDENT# 'Test streaming an HDU to an open file object.' #NEWLINE# arr = np . zeros ( ( 5 , 5 ) , dtype = np . int32 ) #NEWLINE# with open ( self . temp ( 'new.fits' ) , 'ab+' ) as f : #NEWLINE# #INDENT# shdu = self . _make_streaming_hdu ( f ) #NEWLINE# shdu . write ( arr ) #NEWLINE# assert shdu . writecomplete #NEWLINE# assert ( shdu . size == 100 ) #NEWLINE# #UNINDENT# hdul = fits . open ( self . temp ( 'new.fits' ) ) #NEWLINE# assert ( len ( hdul ) == 1 ) #NEWLINE# assert ( hdul [ 0 ] . data == arr ) . all ( )