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
b2564ce0
Commit
b2564ce0
authored
Nov 02, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #19085: Added basic tests for all tkinter widget options.
parents
2b8fc303
758c521e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1919 additions
and
25 deletions
+1919
-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
+2
-0
No files found.
Lib/tkinter/test/support.py
View file @
b2564ce0
...
...
@@ -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 @
b2564ce0
This diff is collapsed.
Click to expand it.
Lib/tkinter/test/test_ttk/test_widgets.py
View file @
b2564ce0
This diff is collapsed.
Click to expand it.
Lib/tkinter/test/widget_tests.py
0 → 100644
View file @
b2564ce0
This diff is collapsed.
Click to expand it.
Misc/NEWS
View file @
b2564ce0
...
...
@@ -147,6 +147,8 @@ Library
Tests
-----
- Issue #19085: Added basic tests for all tkinter widget options.
- Issue 19384: Fix test_py_compile for root user, patch by Claudiu Popa.
Build
...
...
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