def test_write_formats():
 out = StringIO()
 ascii.write(dat, out, Writer=ascii.FixedWidth, formats={'Col1': '%-8.3f', 'Col2': '%-15s'})
 assert_equal_splitlines(out.getvalue(), '|     Col1 |            Col2 | Col3 | Col4 |\n| 1.200    | "hello"         |    1 |    a |\n| 2.400    | \'s worlds       |    2 |    2 |\n')

def test_write_formats ( ) : out = StringIO ( ) ascii . write ( dat , out , Writer = ascii . FixedWidth , formats = { 'Col1' : '%-8.3f' , 'Col2' : '%-15s' } ) assert_equal_splitlines ( out . getvalue ( ) , '|     Col1 |            Col2 | Col3 | Col4 |\n| 1.200    | "hello"         |    1 |    a |\n| 2.400    | \'s worlds       |    2 |    2 |\n' )
write a table as a fixed width table with no delimiter .