File: test_dirctrl.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 (49 lines) | stat: -rw-r--r-- 1,240 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
import unittest
from unittests import wtc
import wx
import os

THIS_FILE = os.path.abspath(__file__)

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

class dirctrl_Tests(wtc.WidgetTestCase):

    def test_dirctrlCtor(self):
        d = wx.GenericDirCtrl(self.frame)


    def test_dirctrlDefaultCtor(self):
        d = wx.GenericDirCtrl()
        d.Create(self.frame)


    def test_dirctrlFlags(self):
        wx.DIRCTRL_DIR_ONLY
        wx.DIRCTRL_SELECT_FIRST
        wx.DIRCTRL_3D_INTERNAL
        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__':
    unittest.main()