0.9.1 of TreeMixin
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import wx, wx.gizmos, wx.lib.customtreectrl, unittest
|
||||
from wx.lib.mixins import treemixin
|
||||
try:
|
||||
import treemixin
|
||||
except ImportError:
|
||||
from wx.lib.mixins import treemixin
|
||||
|
||||
|
||||
# VirtualTree tests
|
||||
@@ -721,6 +724,33 @@ class VanillaCustomTreeCtrlTestCase(VanillaTreeCommonTests,
|
||||
TreeClass = wx.lib.customtreectrl.CustomTreeCtrl
|
||||
|
||||
|
||||
# Tests of the tree controls without any mixin, to document behaviour
|
||||
# that is either different between tree control widgets or undesired
|
||||
# behaviour.
|
||||
|
||||
class TreeCtrlTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.frame = wx.Frame(None)
|
||||
self.tree = wx.TreeCtrl(self.frame, style=wx.TR_HIDE_ROOT)
|
||||
|
||||
def testSelectHiddenRootItem(self):
|
||||
root = self.tree.AddRoot('Hidden root')
|
||||
self.tree.SelectItem(root)
|
||||
self.assertEqual(root, self.tree.GetSelection())
|
||||
|
||||
|
||||
class CustomTreeCtrlTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.frame = wx.Frame(None)
|
||||
self.tree = wx.lib.customtreectrl.CustomTreeCtrl(self.frame,
|
||||
style=wx.TR_HIDE_ROOT)
|
||||
|
||||
def testSelectHiddenRootItem(self):
|
||||
root = self.tree.AddRoot('Hidden root')
|
||||
self.tree.SelectItem(root)
|
||||
self.assertEqual(root, self.tree.GetSelection())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = wx.App(False)
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user