Skip to content
Permalink
Browse files

Add test for move to top action

  • Loading branch information
MieWinstrup authored and nyalldawson committed Apr 5, 2018
1 parent b57a154 commit 44df14d941e7cbce383ebbc239bee79d46b3a2ef
Showing with 11 additions and 0 deletions.
  1. +11 −0 tests/src/python/test_qgslayertreeview.py
@@ -90,6 +90,17 @@ def testDefaultActions(self):
show_in_overview.trigger()
self.assertEqual(view.currentNode().customProperty('overview', 0), False)

def testMoveToTopAction(self):
"""Test move to top action"""
view = QgsLayerTreeView()
view.setModel(self.model)
actions = QgsLayerTreeViewDefaultActions(view)
self.assertEqual(self.project.layerTreeRoot().layerOrder(), [self.layer, self.layer2, self.layer3])
view.setCurrentLayer(self.layer3)
movetotop = actions.actionMoveToTop()
movetotop.trigger()
self.assertEqual(self.project.layerTreeRoot().layerOrder(), [self.layer3, self.layer, self.layer2])


if __name__ == '__main__':
unittest.main()

0 comments on commit 44df14d

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