File: test_filectrl.py

package info (click to toggle)
wxpython4.0 4.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 221,752 kB
  • sloc: cpp: 962,555; python: 230,573; ansic: 170,731; makefile: 51,756; sh: 9,342; perl: 1,564; javascript: 584; php: 326; xml: 200
file content (64 lines) | stat: -rw-r--r-- 2,066 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import unittest
from unittests 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.waitFor(300)

        self.assertEqual(fc.GetFilename(), os.path.basename(__file__))
        self.assertEqual(fc.GetPath(), os.path.abspath(__file__))
        self.assertEqual(fc.Filename, os.path.basename(__file__))
        self.assertEqual(fc.Path, os.path.abspath(__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.waitFor(300)

        self.assertEqual(fc.GetFilenames(), [os.path.basename(__file__)])
        self.assertEqual(fc.GetPaths(), [os.path.abspath(__file__)])
        self.assertEqual(fc.Filenames, [os.path.basename(__file__)])
        self.assertEqual(fc.Paths, [os.path.abspath(__file__)])


#---------------------------------------------------------------------------

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