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
4e59af7a
Commit
4e59af7a
authored
May 04, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#7855: merge with 3.3.
parents
a8bc7fd5
28faf03d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
1 deletion
+51
-1
Lib/ctypes/test/__init__.py
Lib/ctypes/test/__init__.py
+1
-1
Lib/ctypes/test/test_wintypes.py
Lib/ctypes/test/test_wintypes.py
+43
-0
Lib/test/test_winreg.py
Lib/test/test_winreg.py
+3
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ctypes/test/__init__.py
View file @
4e59af7a
...
...
@@ -62,7 +62,7 @@ def get_tests(package, mask, verbosity, exclude=()):
continue
try
:
mod
=
__import__
(
modname
,
globals
(),
locals
(),
[
'*'
])
except
ResourceDenied
as
detail
:
except
(
ResourceDenied
,
unittest
.
SkipTest
)
as
detail
:
skipped
.
append
(
modname
)
if
verbosity
>
1
:
print
(
"Skipped %s: %s"
%
(
modname
,
detail
),
file
=
sys
.
stderr
)
...
...
Lib/ctypes/test/test_wintypes.py
0 → 100644
View file @
4e59af7a
import
sys
import
unittest
if
not
sys
.
platform
.
startswith
(
'win'
):
raise
unittest
.
SkipTest
(
'Windows-only test'
)
from
ctypes
import
*
from
ctypes
import
wintypes
class
WinTypesTest
(
unittest
.
TestCase
):
def
test_variant_bool
(
self
):
# reads 16-bits from memory, anything non-zero is True
for
true_value
in
(
1
,
32767
,
32768
,
65535
,
65537
):
true
=
POINTER
(
c_int16
)(
c_int16
(
true_value
))
value
=
cast
(
true
,
POINTER
(
wintypes
.
VARIANT_BOOL
))
self
.
assertEqual
(
repr
(
value
.
contents
),
'VARIANT_BOOL(True)'
)
vb
=
wintypes
.
VARIANT_BOOL
()
self
.
assertIs
(
vb
.
value
,
False
)
vb
.
value
=
True
self
.
assertIs
(
vb
.
value
,
True
)
vb
.
value
=
true_value
self
.
assertIs
(
vb
.
value
,
True
)
for
false_value
in
(
0
,
65536
,
262144
,
2
**
33
):
false
=
POINTER
(
c_int16
)(
c_int16
(
false_value
))
value
=
cast
(
false
,
POINTER
(
wintypes
.
VARIANT_BOOL
))
self
.
assertEqual
(
repr
(
value
.
contents
),
'VARIANT_BOOL(False)'
)
# allow any bool conversion on assignment to value
for
set_value
in
(
65536
,
262144
,
2
**
33
):
vb
=
wintypes
.
VARIANT_BOOL
()
vb
.
value
=
set_value
self
.
assertIs
(
vb
.
value
,
True
)
vb
=
wintypes
.
VARIANT_BOOL
()
vb
.
value
=
[
2
,
3
]
self
.
assertIs
(
vb
.
value
,
True
)
vb
.
value
=
[]
self
.
assertIs
(
vb
.
value
,
False
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Lib/test/test_winreg.py
View file @
4e59af7a
...
...
@@ -457,6 +457,9 @@ class Win64WinregTests(BaseWinregTests):
DeleteKeyEx
(
HKEY_CURRENT_USER
,
test_reflect_key_name
,
KEY_WOW64_32KEY
,
0
)
def
test_exception_numbers
(
self
):
with
self
.
assertRaises
(
FileNotFoundError
)
as
ctx
:
QueryValue
(
HKEY_CLASSES_ROOT
,
'some_value_that_does_not_exist'
)
def
test_main
():
support
.
run_unittest
(
LocalWinregTests
,
RemoteWinregTests
,
...
...
Misc/ACKS
View file @
4e59af7a
...
...
@@ -1287,6 +1287,7 @@ Nikita Vetoshkin
Al Vezza
Jacques A. Vidrine
John Viega
Dino Viehland
Kannan Vijayan
Kurt Vile
Norman Vine
...
...
Misc/NEWS
View file @
4e59af7a
...
...
@@ -188,6 +188,9 @@ Library
Tests
-----
-
Issue
#
7855
:
Add
tests
for
ctypes
/
winreg
for
issues
found
in
IronPython
.
Initial
patch
by
Dino
Viehland
.
-
Issue
#
11078
:
test___all__
now
checks
for
duplicates
in
__all__
.
Initial
patch
by
R
.
David
Murray
.
...
...
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