Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
30d00ef9
Commit
30d00ef9
authored
Nov 02, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19085: Added basic tests for all tkinter widget options.
parent
9a2b3af6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1922 additions
and
25 deletions
+1922
-25
Lib/tkinter/test/support.py
Lib/tkinter/test/support.py
+39
-0
Lib/tkinter/test/test_tkinter/test_widgets.py
Lib/tkinter/test/test_tkinter/test_widgets.py
+919
-0
Lib/tkinter/test/test_ttk/test_widgets.py
Lib/tkinter/test/test_ttk/test_widgets.py
+472
-25
Lib/tkinter/test/widget_tests.py
Lib/tkinter/test/widget_tests.py
+487
-0
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Lib/tkinter/test/support.py
View file @
30d00ef9
...
...
@@ -77,3 +77,42 @@ def simulate_mouse_click(widget, x, y):
widget
.
event_generate
(
'<Motion>'
,
x
=
x
,
y
=
y
)
widget
.
event_generate
(
'<ButtonPress-1>'
,
x
=
x
,
y
=
y
)
widget
.
event_generate
(
'<ButtonRelease-1>'
,
x
=
x
,
y
=
y
)
import
_tkinter
tcl_version
=
tuple
(
map
(
int
,
_tkinter
.
TCL_VERSION
.
split
(
'.'
)))
def
requires_tcl
(
*
version
):
return
unittest
.
skipUnless
(
tcl_version
>=
version
,
'requires Tcl version >= '
+
'.'
.
join
(
map
(
str
,
version
)))
units
=
{
'c'
:
72
/
2.54
,
# centimeters
'i'
:
72
,
# inches
'm'
:
72
/
25.4
,
# millimeters
'p'
:
1
,
# points
}
def
pixels_conv
(
value
):
return
float
(
value
[:
-
1
])
*
units
[
value
[
-
1
:]]
def
tcl_obj_eq
(
actual
,
expected
):
if
actual
==
expected
:
return
True
if
isinstance
(
actual
,
_tkinter
.
Tcl_Obj
):
if
isinstance
(
expected
,
str
):
return
str
(
actual
)
==
expected
if
isinstance
(
actual
,
tuple
):
if
isinstance
(
expected
,
tuple
):
return
(
len
(
actual
)
==
len
(
expected
)
and
all
(
tcl_obj_eq
(
act
,
exp
)
for
act
,
exp
in
zip
(
actual
,
expected
)))
return
False
def
widget_eq
(
actual
,
expected
):
if
actual
==
expected
:
return
True
if
isinstance
(
actual
,
(
str
,
tkinter
.
Widget
)):
if
isinstance
(
expected
,
(
str
,
tkinter
.
Widget
)):
return
str
(
actual
)
==
str
(
expected
)
return
False
Lib/tkinter/test/test_tkinter/test_widgets.py
0 → 100644
View file @
30d00ef9
This diff is collapsed.
Click to expand it.
Lib/tkinter/test/test_ttk/test_widgets.py
View file @
30d00ef9
This diff is collapsed.
Click to expand it.
Lib/tkinter/test/widget_tests.py
0 → 100644
View file @
30d00ef9
This diff is collapsed.
Click to expand it.
Misc/NEWS
View file @
30d00ef9
...
...
@@ -15,6 +15,11 @@ Library
- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler.
Tests
-----
- Issue #19085: Added basic tests for all tkinter widget options.
What'
s
New
in
Python
3.3.3
release
candidate
1
?
===============================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment