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
63c46403
Commit
63c46403
authored
Jul 27, 2010
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use proper skips and assert* methods in test_asyncore.
parent
f1046ca8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
96 deletions
+97
-96
Lib/test/test_asyncore.py
Lib/test/test_asyncore.py
+97
-96
No files found.
Lib/test/test_asyncore.py
View file @
63c46403
...
...
@@ -118,7 +118,7 @@ class HelperFunctionTests(unittest.TestCase):
# http://mail.python.org/pipermail/python-list/2001-October/109973.html)
# These constants should be present as long as poll is available
if
hasattr
(
select
,
'poll'
):
@
unittest
.
skipUnless
(
hasattr
(
select
,
'poll'
),
'select.poll required'
)
def
test_readwrite
(
self
):
# Check that correct methods are called by readwrite()
...
...
@@ -259,7 +259,7 @@ class DispatcherTests(unittest.TestCase):
sys
.
stderr
=
stderr
lines
=
fp
.
getvalue
().
splitlines
()
self
.
assertEqual
s
(
lines
,
[
'log: %s'
%
l1
,
'log: %s'
%
l2
])
self
.
assertEqual
(
lines
,
[
'log: %s'
%
l1
,
'log: %s'
%
l2
])
def
test_log_info
(
self
):
d
=
asyncore
.
dispatcher
()
...
...
@@ -281,7 +281,7 @@ class DispatcherTests(unittest.TestCase):
lines
=
fp
.
getvalue
().
splitlines
()
expected
=
[
'EGGS: %s'
%
l1
,
'info: %s'
%
l2
,
'SPAM: %s'
%
l3
]
self
.
assertEqual
s
(
lines
,
expected
)
self
.
assertEqual
(
lines
,
expected
)
def
test_unhandled
(
self
):
d
=
asyncore
.
dispatcher
()
...
...
@@ -306,7 +306,7 @@ class DispatcherTests(unittest.TestCase):
'warning: unhandled write event'
,
'warning: unhandled connect event'
,
'warning: unhandled accept event'
]
self
.
assertEqual
s
(
lines
,
expected
)
self
.
assertEqual
(
lines
,
expected
)
def
test_issue_8594
(
self
):
# XXX - this test is supposed to be removed in next major Python
...
...
@@ -322,7 +322,7 @@ class DispatcherTests(unittest.TestCase):
warnings
.
simplefilter
(
"always"
)
family
=
d
.
family
self
.
assertEqual
(
family
,
socket
.
AF_INET
)
self
.
assert
True
(
len
(
w
)
==
1
)
self
.
assert
Equal
(
len
(
w
),
1
)
self
.
assertTrue
(
issubclass
(
w
[
0
].
category
,
DeprecationWarning
))
def
test_strerror
(
self
):
...
...
@@ -331,7 +331,7 @@ class DispatcherTests(unittest.TestCase):
if
hasattr
(
os
,
'strerror'
):
self
.
assertEqual
(
err
,
os
.
strerror
(
errno
.
EPERM
))
err
=
asyncore
.
_strerror
(
-
1
)
self
.
assert
True
(
"unknown error"
in
err
.
lower
())
self
.
assert
In
(
"unknown error"
,
err
.
lower
())
class
dispatcherwithsend_noread
(
asyncore
.
dispatcher_with_send
):
...
...
@@ -394,8 +394,9 @@ class DispatcherWithSendTests(unittest.TestCase):
class
DispatcherWithSendTests_UsePoll
(
DispatcherWithSendTests
):
usepoll
=
True
if
hasattr
(
asyncore
,
'file_wrapper'
):
class
FileWrapperTest
(
unittest
.
TestCase
):
@
unittest
.
skipUnless
(
hasattr
(
asyncore
,
'file_wrapper'
),
'asyncore.file_wrapper required'
)
class
FileWrapperTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
d
=
b"It's not dead, it's sleeping!"
open
(
TESTFN
,
'wb'
).
write
(
self
.
d
)
...
...
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