Skip to content

Commit

Permalink
adapt tests
Browse files Browse the repository at this point in the history
* Don't test removed accessor attribute
* Allow duplicate accessors
  • Loading branch information
samschott committed May 1, 2022
1 parent 6a654ac commit 74a7e66
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/core/tests/widgets/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,16 @@ def test_add_column(self):

self.assertEqual(self.table.headings, expecting_headings)

def test_add_columns_accessor_in_use(self):

new_heading = 'Heading 4'
accessor = 'heading_2'

with self.assertRaises(ValueError):
self.table.add_column(new_heading, accessor)

def test_remove_column_by_accessor(self):
remove = 'heading_2'
dummy_data = [
['a1', 'b1', 'c1'],
]
self.table.data = dummy_data

expecting_accessors = [h for h in self.table._accessors if h != remove]
expected_columns = [col for col in self.table.columns if col.text != remove]
self.table.remove_column(remove)
self.assertEqual(self.table._accessors, expecting_accessors)
self.assertEqual(self.table.columns, expected_columns)

def test_remove_column_by_position(self):
remove = 2
Expand Down

0 comments on commit 74a7e66

Please sign in to comment.