def test_select(self): tableset = TableSet(self.tables.values(), self.tables.keys()) new_tableset = tableset.select(['number']) for name, new_table in new_tableset.items(): self.assertColumnNames(new_table, ('number',)) self.assertColumnTypes(new_table, (Number,))
def test_select(self): tableset = TableSet(self.tables.values(), self.tables.keys()) new_tableset = tableset.select(['number']) for name, new_table in new_tableset.items(): self.assertColumnNames(new_table, ('number',)) self.assertColumnTypes(new_table, (Number,))
def test_select(self): tableset = TableSet(self.tables.values(), self.tables.keys()) new_tableset = tableset.select(['number']) for name, new_table in new_tableset.items(): self.assertEqual(len(new_table.rows), 3) self.assertEqual(len(new_table.columns), 1) self.assertSequenceEqual(new_table._column_types, (self.number_type,)) self.assertSequenceEqual(new_table._column_names, ('number',))
def test_select(self): tableset = TableSet(self.tables.values(), self.tables.keys()) new_tableset = tableset.select(['number']) for name, new_table in new_tableset.items(): self.assertEqual(len(new_table.rows), 3) self.assertEqual(len(new_table.columns), 1) self.assertSequenceEqual(new_table._column_types, (self.number_type,)) self.assertSequenceEqual(new_table._column_names, ('number',))
def test_proxy_maintains_key(self): number_type = Number() tableset = TableSet(self.tables.values(), self.tables.keys(), key_name='foo', key_type=number_type) self.assertEqual(tableset.key_name, 'foo') self.assertEqual(tableset.key_type, number_type) new_tableset = tableset.select(['number']) self.assertEqual(new_tableset.key_name, 'foo') self.assertEqual(new_tableset.key_type, number_type)
def test_proxy_maintains_key(self): number_type = Number() tableset = TableSet(self.tables.values(), self.tables.keys(), key_name='foo', key_type=number_type) self.assertEqual(tableset.key_name, 'foo') self.assertEqual(tableset.key_type, number_type) new_tableset = tableset.select(['number']) self.assertEqual(new_tableset.key_name, 'foo') self.assertEqual(new_tableset.key_type, number_type)