Skip to content
Permalink
Browse files

Added test of the action 'Move Out of Group' in the layer panel

  • Loading branch information
MieWinstrup authored and nyalldawson committed May 4, 2018
1 parent b9b85f9 commit a36f6aa2e683dd85ce10849baac3dbc2be7c0c4f
Showing with 30 additions and 0 deletions.
  1. +30 −0 tests/src/python/test_qgslayertreeview.py
@@ -111,6 +111,36 @@ def testDefaultActions(self):
show_in_overview.trigger()
self.assertEqual(view.currentNode().customProperty('overview', 0), False)

def testMoveOutOfGroupActionLayer(self):
"""Test move out of group action on layer"""
view = QgsLayerTreeView()
group = self.project.layerTreeRoot().addGroup("embeddedgroup")
group.addLayer(self.layer4)
group.addLayer(self.layer5)
groupname = group.name()
view.setModel(self.model)
actions = QgsLayerTreeViewDefaultActions(view)
self.assertEqual(self.nodeOrder(self.project.layerTreeRoot().children()), [
self.layer.name(),
self.layer2.name(),
self.layer3.name(),
groupname,
groupname + '-' + self.layer4.name(),
groupname + '-' + self.layer5.name(),
])

view.setCurrentLayer(self.layer5)
moveOutOfGroup = actions.actionMoveOutOfGroup()
moveOutOfGroup.trigger()
self.assertEqual(self.nodeOrder(self.project.layerTreeRoot().children()), [
self.layer.name(),
self.layer2.name(),
self.layer3.name(),
self.layer5.name(),
groupname,
groupname + '-' + self.layer4.name(),
])

def testMoveToTopActionLayer(self):
"""Test move to top action on layer"""
view = QgsLayerTreeView()

0 comments on commit a36f6aa

Please sign in to comment.
You can’t perform that action at this time.