def test_write_table_html_fill_values_masked():
 buffer_output = StringIO()
 t = Table([[1], [1]], names=('a', 'b'), masked=True, dtype=('i4', 'i8'))
 t['a'] = np.ma.masked
 ascii.write(t, buffer_output, fill_values=(ascii.masked, 'TEST'), format='html')
 t_expected = Table([['TEST'], [1]], names=('a', 'b'))
 buffer_expected = StringIO()
 ascii.write(t_expected, buffer_expected, format='html')
 assert (buffer_output.getvalue() == buffer_expected.getvalue())

def test_write_table_html_fill_values_masked ( ) : buffer_output = StringIO ( ) t = Table ( [ [ 1 ] , [ 1 ] ] , names = ( 'a' , 'b' ) , masked = True , dtype = ( 'i4' , 'i8' ) ) t [ 'a' ] = np . ma . masked ascii . write ( t , buffer_output , fill_values = ( ascii . masked , 'TEST' ) , format = 'html' ) t_expected = Table ( [ [ 'TEST' ] , [ 1 ] ] , names = ( 'a' , 'b' ) ) buffer_expected = StringIO ( ) ascii . write ( t_expected , buffer_expected , format = 'html' ) assert ( buffer_output . getvalue ( ) == buffer_expected . getvalue ( ) )
test that passing masked values in fill_values should only replace masked columns or values .