def test_guess_with_names_arg():
 dat = ascii.read(['1,2', '3,4'], names=('a', 'b'))
 assert (len(dat) == 2)
 assert (dat.colnames == ['a', 'b'])
 dat = ascii.read(['c,d', '3,4'], names=('a', 'b'))
 assert (len(dat) == 1)
 assert (dat.colnames == ['a', 'b'])
 dat = ascii.read(['c d', 'e f'], names=('a', 'b'))
 assert (len(dat) == 1)
 assert (dat.colnames == ['a', 'b'])

def test_guess_with_names_arg ( ) : dat = ascii . read ( [ '1,2' , '3,4' ] , names = ( 'a' , 'b' ) ) assert ( len ( dat ) == 2 ) assert ( dat . colnames == [ 'a' , 'b' ] ) dat = ascii . read ( [ 'c,d' , '3,4' ] , names = ( 'a' , 'b' ) ) assert ( len ( dat ) == 1 ) assert ( dat . colnames == [ 'a' , 'b' ] ) dat = ascii . read ( [ 'c d' , 'e f' ] , names = ( 'a' , 'b' ) ) assert ( len ( dat ) == 1 ) assert ( dat . colnames == [ 'a' , 'b' ] )
make sure reading a table with guess=true gives the expected result when the names arg is specified .