mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 03:20:08 +01:00
Add wx.FileCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
62
unittests/test_filectrl.py
Normal file
62
unittests/test_filectrl.py
Normal file
@@ -0,0 +1,62 @@
|
||||
import imp_unittest, unittest
|
||||
import wtc
|
||||
import wx
|
||||
import os
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class filectrl_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_filectrl1(self):
|
||||
fc = wx.FileCtrl(self.frame)
|
||||
|
||||
def test_filectrl2(self):
|
||||
fc = wx.FileCtrl()
|
||||
fc.Create(self.frame)
|
||||
|
||||
def test_filectrl3(self):
|
||||
wx.FC_OPEN
|
||||
wx.FC_SAVE
|
||||
wx.FC_MULTIPLE
|
||||
wx.FC_NOSHOWHIDDEN
|
||||
wx.FC_DEFAULT_STYLE
|
||||
|
||||
wx.wxEVT_FILECTRL_SELECTIONCHANGED
|
||||
wx.wxEVT_FILECTRL_FILEACTIVATED
|
||||
wx.wxEVT_FILECTRL_FOLDERCHANGED
|
||||
wx.wxEVT_FILECTRL_FILTERCHANGED
|
||||
wx.EVT_FILECTRL_SELECTIONCHANGED
|
||||
wx.EVT_FILECTRL_FILEACTIVATED
|
||||
wx.EVT_FILECTRL_FOLDERCHANGED
|
||||
wx.EVT_FILECTRL_FILTERCHANGED
|
||||
wx.FileCtrlEvent
|
||||
|
||||
|
||||
def test_filectrl4(self):
|
||||
fc = wx.FileCtrl(self.frame,
|
||||
defaultDirectory=os.path.dirname(__file__),
|
||||
defaultFilename=os.path.basename(__file__),
|
||||
style=wx.FC_OPEN)
|
||||
|
||||
self.assertEqual(fc.GetFilename(), os.path.basename(__file__))
|
||||
self.assertEqual(fc.GetPath(), __file__)
|
||||
self.assertEqual(fc.Filename, os.path.basename(__file__))
|
||||
self.assertEqual(fc.Path, __file__)
|
||||
|
||||
|
||||
def test_filectrl5(self):
|
||||
fc = wx.FileCtrl(self.frame,
|
||||
defaultDirectory=os.path.dirname(__file__),
|
||||
defaultFilename=os.path.basename(__file__),
|
||||
style=wx.FC_OPEN|wx.FC_MULTIPLE)
|
||||
|
||||
self.assertEqual(fc.GetFilenames(), [os.path.basename(__file__)])
|
||||
self.assertEqual(fc.GetPaths(), [__file__])
|
||||
self.assertEqual(fc.Filenames, [os.path.basename(__file__)])
|
||||
self.assertEqual(fc.Paths, [__file__])
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user