@@ -26,15 +26,6 @@ def test_open_file_good_params(self):
26
26
# running as batch of unit tests.
27
27
pass
28
28
29
- def test_open_file_bad_params (self ):
30
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
31
- with self .assertRaises (TypeError ):
32
- Dialog .open_file (initial_dir = 1 )
33
- with self .assertRaises (TypeError ):
34
- Dialog .open_file (title = lambda : None )
35
- with self .assertRaises (TypeError ):
36
- Dialog .open_file (file_types = [0 , 0 , 0 ])
37
-
38
29
def test_save_file_no_params (self ):
39
30
self .root .after (ms = 1000 , func = lambda : self .root .close ())
40
31
Dialog .save_file ()
@@ -45,15 +36,6 @@ def test_save_file_good_params(self):
45
36
file_types = (("Text files" , "*.txt" ),
46
37
("All files" , "*.*" )))
47
38
48
- def test_save_file_bad_params (self ):
49
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
50
- with self .assertRaises (TypeError ):
51
- Dialog .save_file (initial_dir = 1 )
52
- with self .assertRaises (TypeError ):
53
- Dialog .save_file (title = lambda : None )
54
- with self .assertRaises (TypeError ):
55
- Dialog .save_file (file_types = [0 , 0 , 0 ])
56
-
57
39
def test_select_directory_no_params (self ):
58
40
self .root .after (ms = 1000 , func = lambda : self .root .close ())
59
41
Dialog .select_directory ()
@@ -62,13 +44,6 @@ def test_select_directory_good_params(self):
62
44
self .root .after (ms = 1000 , func = lambda : self .root .close ())
63
45
Dialog .select_directory (initial_dir = Path .cwd (), title = "Foo bar" )
64
46
65
- def test_select_directory_bad_params (self ):
66
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
67
- with self .assertRaises (TypeError ):
68
- Dialog .select_directory (initial_dir = 1 )
69
- with self .assertRaises (TypeError ):
70
- Dialog .select_directory (title = lambda : None )
71
-
72
47
def test_color_chooser_no_params (self ):
73
48
self .root .after (ms = 1000 , func = lambda : self .root .close ())
74
49
Dialog .choose_color ()
@@ -77,13 +52,6 @@ def test_color_chooser_good_params(self):
77
52
self .root .after (ms = 1000 , func = lambda : self .root .close ())
78
53
Dialog .choose_color (initial_color = "101010" , as_rgb = True )
79
54
80
- def test_color_chooser_bad_params (self ):
81
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
82
- with self .assertRaises (TypeError ):
83
- Dialog .choose_color (initial_color = 1234 )
84
- with self .assertRaises (TypeError ):
85
- Dialog .choose_color (as_rgb = 42 )
86
-
87
55
def test_info_box_no_params (self ):
88
56
self .root .after (ms = 1000 , func = lambda : self .root .close ())
89
57
with self .assertRaises (TypeError ):
@@ -93,17 +61,6 @@ def test_info_box_good_params(self):
93
61
self .root .after (ms = 1000 , func = lambda : self .root .close ())
94
62
Dialog .show_info (parent = self .root , title = "Title" , message = "Message" , detail = "Details" )
95
63
96
- def test_info_box_bad_params (self ):
97
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
98
- with self .assertRaises (TypeError ):
99
- Dialog .show_info (parent = 321123 , title = "" , message = "" )
100
- with self .assertRaises (TypeError ):
101
- Dialog .show_info (self .root , title = False , message = "" )
102
- with self .assertRaises (TypeError ):
103
- Dialog .show_info (self .root , title = "" , message = ())
104
- with self .assertRaises (TypeError ):
105
- Dialog .show_info (self .root , title = "" , message = "" , detail = [])
106
-
107
64
def test_warning_box_no_params (self ):
108
65
self .root .after (ms = 1000 , func = lambda : self .root .close ())
109
66
with self .assertRaises (TypeError ):
@@ -113,17 +70,6 @@ def test_warning_box_good_params(self):
113
70
self .root .after (ms = 1000 , func = lambda : self .root .close ())
114
71
Dialog .show_warning (parent = self .root , title = "Title" , message = "Message" , detail = "Details" )
115
72
116
- def test_warning_box_bad_params (self ):
117
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
118
- with self .assertRaises (TypeError ):
119
- Dialog .show_warning (parent = "asdf" , title = "" , message = "" )
120
- with self .assertRaises (TypeError ):
121
- Dialog .show_warning (self .root , title = 1 , message = "" )
122
- with self .assertRaises (TypeError ):
123
- Dialog .show_warning (self .root , title = "" , message = lambda : None )
124
- with self .assertRaises (TypeError ):
125
- Dialog .show_warning (self .root , title = "" , message = "" , detail = [])
126
-
127
73
def test_error_box_no_params (self ):
128
74
self .root .after (ms = 1000 , func = lambda : self .root .close ())
129
75
with self .assertRaises (TypeError ):
@@ -138,17 +84,6 @@ def test_error_box_good_params(self):
138
84
except tk .TclError :
139
85
pass
140
86
141
- def test_error_box_bad_params (self ):
142
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
143
- with self .assertRaises (TypeError ):
144
- Dialog .show_error (parent = "asdf" , title = "" , message = "" )
145
- with self .assertRaises (TypeError ):
146
- Dialog .show_error (self .root , title = 1 , message = "" )
147
- with self .assertRaises (TypeError ):
148
- Dialog .show_error (self .root , title = "" , message = lambda : None )
149
- with self .assertRaises (TypeError ):
150
- Dialog .show_error (self .root , title = "" , message = "" , detail = [])
151
-
152
87
def test_ok_cancel_box_no_params (self ):
153
88
self .root .after (ms = 1000 , func = lambda : self .root .close ())
154
89
with self .assertRaises (TypeError ):
@@ -158,17 +93,6 @@ def test_ok_cancel_box_good_params(self):
158
93
self .root .after (ms = 1000 , func = lambda : self .root .close ())
159
94
Dialog .ask_ok_or_cancel (parent = self .root , title = "Title" , message = "Message" , detail = "Details" )
160
95
161
- def test_ok_cancel_box_bad_params (self ):
162
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
163
- with self .assertRaises (TypeError ):
164
- Dialog .ask_ok_or_cancel (parent = "asdf" , title = "" , message = "" )
165
- with self .assertRaises (TypeError ):
166
- Dialog .ask_ok_or_cancel (self .root , title = 1 , message = "" )
167
- with self .assertRaises (TypeError ):
168
- Dialog .ask_ok_or_cancel (self .root , title = "" , message = lambda : None )
169
- with self .assertRaises (TypeError ):
170
- Dialog .ask_ok_or_cancel (self .root , title = "" , message = "" , detail = [])
171
-
172
96
def test_yes_no_box_no_params (self ):
173
97
self .root .after (ms = 1000 , func = lambda : self .root .close ())
174
98
with self .assertRaises (TypeError ):
@@ -178,17 +102,6 @@ def test_yes_no_box_good_params(self):
178
102
self .root .after (ms = 1000 , func = lambda : self .root .close ())
179
103
Dialog .ask_yes_or_no (parent = self .root , title = "Title" , message = "Message" , detail = "Details" )
180
104
181
- def test_yes_no_box_bad_params (self ):
182
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
183
- with self .assertRaises (TypeError ):
184
- Dialog .ask_yes_or_no (parent = "asdf" , title = "" , message = "" )
185
- with self .assertRaises (TypeError ):
186
- Dialog .ask_yes_or_no (self .root , title = 1 , message = "" )
187
- with self .assertRaises (TypeError ):
188
- Dialog .ask_yes_or_no (self .root , title = "" , message = lambda : None )
189
- with self .assertRaises (TypeError ):
190
- Dialog .ask_yes_or_no (self .root , title = "" , message = "" , detail = [])
191
-
192
105
def test_yes_no_cancel_box_no_params (self ):
193
106
self .root .after (ms = 1000 , func = lambda : self .root .close ())
194
107
with self .assertRaises (TypeError ):
@@ -198,18 +111,6 @@ def test_yes_no_cancel_box_good_params(self):
198
111
self .root .after (ms = 1000 , func = lambda : self .root .close ())
199
112
Dialog .ask_yes_or_no_or_cancel (parent = self .root , title = "Title" , message = "Message" , detail = "Details" )
200
113
201
- def test_yes_no_cancel_box_bad_params (self ):
202
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
203
- with self .assertRaises (TypeError ):
204
- Dialog .ask_yes_or_no_or_cancel (parent = "asdf" , title = "" , message = "" )
205
- with self .assertRaises (TypeError ):
206
- Dialog .ask_yes_or_no_or_cancel (self .root , title = 1 , message = "" )
207
- with self .assertRaises (TypeError ):
208
- Dialog .ask_yes_or_no_or_cancel (self .root , title = "" , message = lambda : None )
209
- with self .assertRaises (TypeError ):
210
- Dialog .ask_yes_or_no_or_cancel (self .root , title = "" , message = "" ,
211
- detail = [])
212
-
213
114
def test_retry_cancel_box_no_params (self ):
214
115
self .root .after (ms = 1000 , func = lambda : self .root .close ())
215
116
with self .assertRaises (TypeError ):
@@ -219,22 +120,9 @@ def test_retry_cancel_box_good_params(self):
219
120
self .root .after (ms = 1000 , func = lambda : self .root .close ())
220
121
Dialog .ask_retry_cancel (parent = self .root , title = "Title" , message = "Message" , detail = "Details" )
221
122
222
- def test_retry_cancel_box_bad_params (self ):
223
- self .root .after (ms = 1000 , func = lambda : self .root .close ())
224
- with self .assertRaises (TypeError ):
225
- Dialog .ask_retry_cancel (parent = "asdf" , message = "" , title = "" )
226
- with self .assertRaises (TypeError ):
227
- Dialog .ask_retry_cancel (self .root , title = 1 , message = "" )
228
- with self .assertRaises (TypeError ):
229
- Dialog .ask_retry_cancel (self .root , title = "" , message = lambda : None )
230
- with self .assertRaises (TypeError ):
231
- Dialog .ask_retry_cancel (self .root , title = "" , message = "" , detail = [])
232
-
233
123
def test_custom_dialog (self ):
234
124
self .root .lift ()
235
125
self .root .after (ms = 1000 , func = lambda : self .root .close ())
236
- with self .assertRaises (TypeError ):
237
- Dialog .CustomDialog (parent = "lol" )
238
126
dialog = Dialog .CustomDialog (parent = self .root )
239
127
dialog .title = "Title"
240
128
# Must lift everything otherwise it hasn't drawn and grabbing the
0 commit comments