mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 04:50:07 +01:00
Add test cases for GenericDirCtrl.GetPath and GetPaths
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import unittest
|
||||
from unittests import wtc
|
||||
import wx
|
||||
import os
|
||||
|
||||
THIS_FILE = os.path.abspath(__file__)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -22,6 +25,24 @@ class dirctrl_Tests(wtc.WidgetTestCase):
|
||||
wx.DIRCTRL_EDIT_LABELS
|
||||
wx.DIRCTRL_MULTIPLE
|
||||
|
||||
def test_dirctrlGetPath(self):
|
||||
d = wx.GenericDirCtrl(self.frame)
|
||||
d.ExpandPath(os.path.dirname(THIS_FILE))
|
||||
d.SelectPath(THIS_FILE)
|
||||
p = d.GetPath()
|
||||
assert isinstance(p, str)
|
||||
assert p == THIS_FILE
|
||||
|
||||
def test_dirctrlGetPaths(self):
|
||||
d = wx.GenericDirCtrl(self.frame, style=wx.DIRCTRL_MULTIPLE)
|
||||
d.ExpandPath(os.path.dirname(THIS_FILE))
|
||||
d.SelectPaths([THIS_FILE])
|
||||
p = d.GetPaths()
|
||||
assert isinstance(p, list)
|
||||
assert p == [THIS_FILE]
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user