Skip to content

Commit

Permalink
Added test of the action 'Move Out of Group' in the layer panel
Browse files Browse the repository at this point in the history
  • Loading branch information
MieWinstrup authored and nyalldawson committed May 4, 2018
1 parent b9b85f9 commit a36f6aa
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/src/python/test_qgslayertreeview.py
Expand Up @@ -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()
Expand Down

0 comments on commit a36f6aa

Please sign in to comment.