File: TextDialog_test.py

package info (click to toggle)
python-pmw 0.8.5-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,820 kB
  • ctags: 3,468
  • sloc: python: 14,898; makefile: 37; sh: 17
file content (53 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (6)
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
import Tkinter
import Test
import Pmw

Test.initialise()

c = Pmw.TextDialog

kw_1 = {
    'scrolledtext_labelpos': 'n',
    'label_text' : 'Here is the news',
    'buttons' : ('OK', 'Cancel'),
    'buttonbox_padx': 30,
}
tests_1 = (
  (Test.num_options, (), 11),
  ('text_wrap', 'none'),
  ('text_state', 'disabled'),
  ('hull_background', '#d9d9d9'),
  ('label_bitmap', 'warning'),
  ('hull_cursor', 'gumby'),
  ('label_image', Test.flagup),
  ('text_font', Test.font['variable']),
  ('text_foreground', 'red'),
  ('text_padx', 15),
  ('text_pady', 15),
  ('label_image', ''),
  ('label_bitmap', ''),
  (c.title, 'TextDialog 1: new title', ''),
  (c.interior, (), Tkinter.Frame),
  ('defaultbutton', 'OK'), 
  (c.clear, ()),
  (c.get, (), '\n'),
)

kw_2 = {
    'buttons' : ('OK', 'Cancel'),
    'buttonboxpos': 'e',
    'scrolledtext_labelpos': 'n',
}
tests_2 = (
  (c.title, 'TextDialog 2', ''),
)

alltests = (
  (tests_1, kw_1),
  (tests_2, kw_2),
)

testData = ((c, alltests),)

if __name__ == '__main__':
    Test.runTests(testData)