Beispiel #1
0
 def test_insert_horizontal_header_labels(self):
     """Test the insert_horizontal_header_labels() method of MinimalTableModel."""
     model = MinimalTableModel()
     model.insert_horizontal_header_labels(0, ['a', 'b'])
     self.assertEqual(model.horizontal_header_labels(), ['a', 'b'])
     model.insert_horizontal_header_labels(0, ['c'])
     self.assertEqual(model.horizontal_header_labels(), ['c', 'a', 'b'])
     model.insert_horizontal_header_labels(1, ['d'])
     self.assertEqual(model.horizontal_header_labels(),
                      ['c', 'd', 'a', 'b'])
     model.insert_horizontal_header_labels(4, ['e'])
     self.assertEqual(model.horizontal_header_labels(),
                      ['c', 'd', 'a', 'b', 'e'])
Beispiel #2
0
 def test_setHeaderData(self):
     """Test the setHeaderData() method of MinimalTableModel."""
     model = MinimalTableModel()
     model.set_horizontal_header_labels(['a'])
     self.assertTrue(model.setHeaderData(0, Qt.Horizontal, 'b'))
     self.assertEqual(model.horizontal_header_labels(), ['b'])
     self.assertFalse(model.setHeaderData(0, Qt.Vertical, 'c'))
     self.assertFalse(
         model.setHeaderData(0, Qt.Horizontal, 'd', role=Qt.ToolTipRole))
     self.assertIsNone(model.headerData(0, role=Qt.ToolTipRole))
Beispiel #3
0
 def test_set_horizontal_header_labels(self):
     """Test the set_horizontal_header_labels() method of MinimalTableModel."""
     model = MinimalTableModel()
     model.set_horizontal_header_labels(['a', 'b'])
     self.assertEqual(model.horizontal_header_labels(), ['a', 'b'])