def test_get_items(mixin_cols):
 attrs = ('name', 'unit', 'dtype', 'format', 'description', 'meta')
 m = mixin_cols['m']
 m.info.name = 'm'
 m.info.format = '{0}'
 m.info.description = 'd'
 m.info.meta = {'a': 1}
 t = QTable([m])
 for item in ([1, 3], np.array([0, 2]), slice(1, 3)):
  t2 = t[item]
  m2 = m[item]
  assert_table_name_col_equal(t2, 'm', m[item])
  for attr in attrs:
   assert (getattr(t2['m'].info, attr) == getattr(m.info, attr))
   assert (getattr(m2.info, attr) == getattr(m.info, attr))

def test_get_items ( mixin_cols ) : attrs = ( 'name' , 'unit' , 'dtype' , 'format' , 'description' , 'meta' ) m = mixin_cols [ 'm' ] m . info . name = 'm' m . info . format = '{0}' m . info . description = 'd' m . info . meta = { 'a' : 1 } t = QTable ( [ m ] ) for item in ( [ 1 , 3 ] , np . array ( [ 0 , 2 ] ) , slice ( 1 , 3 ) ) : t2 = t [ item ] m2 = m [ item ] assert_table_name_col_equal ( t2 , 'm' , m [ item ] ) for attr in attrs : assert ( getattr ( t2 [ 'm' ] . info , attr ) == getattr ( m . info , attr ) ) assert ( getattr ( m2 . info , attr ) == getattr ( m . info , attr ) )
test that slicing / indexing table gives right values and col attrs inherit .