def test_conversion_qtable_table():
 qt = QTable(MIXIN_COLS)
 names = qt.colnames
 for name in names:
  qt[name].info.description = name
 t = Table(qt)
 for name in names:
  assert (t[name].info.description == name)
  if (name == 'quantity'):
   assert np.all((t['quantity'] == qt['quantity'].value))
   assert np.all((t['quantity'].unit is qt['quantity'].unit))
   assert isinstance(t['quantity'], t.ColumnClass)
  else:
   assert_table_name_col_equal(t, name, qt[name])
 qt2 = QTable(qt)
 for name in names:
  assert (qt2[name].info.description == name)
  assert_table_name_col_equal(qt2, name, qt[name])

def test_conversion_qtable_table ( ) : qt = QTable ( MIXIN_COLS ) names = qt . colnames for name in names : qt [ name ] . info . description = name t = Table ( qt ) for name in names : assert ( t [ name ] . info . description == name ) if ( name == 'quantity' ) : assert np . all ( ( t [ 'quantity' ] == qt [ 'quantity' ] . value ) ) assert np . all ( ( t [ 'quantity' ] . unit is qt [ 'quantity' ] . unit ) ) assert isinstance ( t [ 'quantity' ] , t . ColumnClass ) else : assert_table_name_col_equal ( t , name , qt [ name ] ) qt2 = QTable ( qt ) for name in names : assert ( qt2 [ name ] . info . description == name ) assert_table_name_col_equal ( qt2 , name , qt [ name ] )
test that a table round trips from qtable => table => qtable .