@pytest.mark.skipif('not HAS_BEAUTIFUL_SOUP')
def test_rename_cols():
 table_in = ['<table>', '<tr><th>A</th> <th>B</th></tr>', '<tr><td>1</td><td>2</td></tr>', '</table>']
 dat = Table.read(table_in, format='ascii.html', names=['B', 'A'])
 assert (dat.colnames == ['B', 'A'])
 assert (len(dat) == 1)
 dat = Table.read(table_in, format='ascii.html', names=['B', 'A'], include_names=['A'])
 assert (dat.colnames == ['A'])
 assert (len(dat) == 1)
 assert np.all((dat['A'] == 2))

@ pytest . mark . skipif ( 'not HAS_BEAUTIFUL_SOUP' ) def test_rename_cols ( ) : table_in = [ '<table>' , '<tr><th>A</th> <th>B</th></tr>' , '<tr><td>1</td><td>2</td></tr>' , '</table>' ] dat = Table . read ( table_in , format = 'ascii.html' , names = [ 'B' , 'A' ] ) assert ( dat . colnames == [ 'B' , 'A' ] ) assert ( len ( dat ) == 1 ) dat = Table . read ( table_in , format = 'ascii.html' , names = [ 'B' , 'A' ] , include_names = [ 'A' ] ) assert ( dat . colnames == [ 'A' ] ) assert ( len ( dat ) == 1 ) assert np . all ( ( dat [ 'A' ] == 2 ) )
test reading a table and renaming cols .