Ejemplo n.º 1
0
 def test_remove_subset_triggers_selection_changed(self):
     layer = self.add_layer()
     grp = self.collect.new_subset_group()
     mock = MagicMock()
     self.select_layers(grp)
     self.widget.layerTree.selection_changed.connect(mock)
     QTest.mousePress(self.widget.layerRemoveButton, Qt.LeftButton)
     QTest.mouseRelease(self.widget.layerRemoveButton, Qt.LeftButton)
     assert mock.call_count > 0
Ejemplo n.º 2
0
    def test_drag_drop(self):
        QTest.mousePress(self.w1, Qt.LeftButton)
        QTest.mouseMove(self.w2)
        QTest.mouseRelease(self.w2, Qt.LeftButton)

        assert self.w2.last_mime == self.m1
Ejemplo n.º 3
0
 def test_empty_removal_does_nothing(self):
     """ Make sure widgets are only removed when selected """
     layer = self.add_layer()
     self.widget.layerTree.clearSelection()
     QTest.mousePress(self.widget.layerRemoveButton, Qt.LeftButton)
     assert self.layer_present(layer)
Ejemplo n.º 4
0
 def remove_layer(self, layer):
     """ Remove a layer via the widget remove button """
     self.select_layers(layer)
     QTest.mousePress(self.widget.layerRemoveButton, Qt.LeftButton)
     QTest.mouseRelease(self.widget.layerRemoveButton, Qt.LeftButton)