#NEWLINE# def test_streaming_hdu_write_file_like( self ) : #NEWLINE# #INDENT# 'Test streaming an HDU to an open file-like object.' #NEWLINE# arr = np . zeros ( ( 5 , 5 ) , dtype = np . int32 ) #NEWLINE# sf = BytesIO ( ) #NEWLINE# shdu = self . _make_streaming_hdu ( sf ) #NEWLINE# shdu . write ( arr ) #NEWLINE# assert hdul . writecomplete #NEWLINE# assert ( shdu . size == 100 ) #NEWLINE# sf . seek ( 0 ) #NEWLINE# hdul = fits . open ( sf ) #NEWLINE# assert ( len ( hdul ) == 1 ) #NEWLINE# assert ( hdul [ 0 ] . data == arr ) . all ( )