diff --git a/sew/_core.py b/sew/_core.py index 530ed60..46f20ca 100644 --- a/sew/_core.py +++ b/sew/_core.py @@ -526,7 +526,7 @@ def cols(self): @property def columns(self): ''' - Dictionary of ColumnProxy objects based on the table columns. + Container of ColumnProxy objects based on the table columns. ''' return self._cols diff --git a/tests/correctness.py b/tests/correctness.py index d9d3f29..e5f0dd3 100644 --- a/tests/correctness.py +++ b/tests/correctness.py @@ -25,7 +25,28 @@ def setUp(self): ) # self.d.reloadTables() + def test_column_getter(self): + self.assertEqual( + self.d['correctness'].columnNames, + ["col1", "col2", "col3"] + ) + columns = self.d['correctness'].columns + self.assertEqual( + columns, + self.d['correctness'].cols + ) + + # Check each object's parameters + for i in range(3): + self.assertEqual(columns[i].typehint, float) + self.assertEqual(columns[i].tablename, 'correctness') + + self.assertEqual(columns[0].name, 'col1') + self.assertEqual(columns[1].name, 'col2') + self.assertEqual(columns[2].name, 'col3') + # %% + def test_create_table_insert_drop(self): fmtspec = sew.FormatSpecifier() fmtspec.addColumn('c1', int)