Ejemplo n.º 1
0
 def test_copy_selection(self):
     model = MapModel(Map(["A"], [2.3]))
     table_view = MapTableView()
     table_view.setModel(model)
     for column in (0, 1):
         table_view.selectionModel().select(model.index(0, column),
                                            QItemSelectionModel.Select)
     self.assertTrue(table_view.copy())
     clip = StringIO(QApplication.clipboard().text())
     table = [row for row in csv.reader(clip, delimiter="\t")]
     self.assertEqual(table, [["A", "2.3"]])
Ejemplo n.º 2
0
 def test_copy_without_selection_returns_false(self):
     model = MapModel(Map([], [], float))
     table_view = MapTableView()
     table_view.setModel(model)
     self.assertFalse(table_view.copy())