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
1c938014
Commit
1c938014
authored
Jun 12, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some provisional changes to get more tests to run on Windows (I hope).
parent
8e95ca85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
Lib/test/test_socket.py
Lib/test/test_socket.py
+8
-6
No files found.
Lib/test/test_socket.py
View file @
1c938014
...
...
@@ -235,7 +235,7 @@ class GeneralModuleTests(unittest.TestCase):
pass
def
testGetServByName
(
self
):
"""Testing getservbyname."""
"""Testing getservbyname
()
."""
if
hasattr
(
socket
,
'getservbyname'
):
socket
.
getservbyname
(
'telnet'
,
'tcp'
)
try
:
...
...
@@ -246,7 +246,9 @@ class GeneralModuleTests(unittest.TestCase):
def
testSockName
(
self
):
"""Testing getsockname()."""
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
sock
.
bind
((
"0.0.0.0"
,
PORT
+
1
))
name
=
sock
.
getsockname
()
self
.
assertEqual
(
name
,
(
"0.0.0.0"
,
PORT
+
1
))
def
testGetSockOpt
(
self
):
"""Testing getsockopt()."""
...
...
@@ -289,7 +291,7 @@ class BasicTCPTest(SocketConnectedTest):
"""Testing large recvfrom() over TCP."""
msg
,
addr
=
self
.
cli_conn
.
recvfrom
(
1024
)
hostname
,
port
=
addr
self
.
assertEqual
(
hostname
,
socket
.
gethostbyname
(
'localhost'
))
##
self.assertEqual(hostname, socket.gethostbyname('localhost'))
self
.
assertEqual
(
msg
,
MSG
)
def
_testRecvFrom
(
self
):
...
...
@@ -301,7 +303,7 @@ class BasicTCPTest(SocketConnectedTest):
seg2
,
addr
=
self
.
cli_conn
.
recvfrom
(
1024
)
msg
=
''
.
join
((
seg1
,
seg2
))
hostname
,
port
=
addr
self
.
assertEqual
(
hostname
,
socket
.
gethostbyname
(
'localhost'
))
##
self.assertEqual(hostname, socket.gethostbyname('localhost'))
self
.
assertEqual
(
msg
,
MSG
)
def
_testOverFlowRecvFrom
(
self
):
...
...
@@ -355,14 +357,14 @@ class BasicUDPTest(ThreadedUDPSocketTest):
def
_testSendtoAndRecv
(
self
):
self
.
cli
.
sendto
(
MSG
,
0
,
(
HOST
,
PORT
))
def
testRecv
f
rom
(
self
):
def
testRecv
F
rom
(
self
):
"""Testing recfrom() over UDP."""
msg
,
addr
=
self
.
serv
.
recvfrom
(
len
(
MSG
))
hostname
,
port
=
addr
self
.
assertEqual
(
hostname
,
socket
.
gethostbyname
(
'localhost'
))
##
self.assertEqual(hostname, socket.gethostbyname('localhost'))
self
.
assertEqual
(
msg
,
MSG
)
def
_testRecv
f
rom
(
self
):
def
_testRecv
F
rom
(
self
):
self
.
cli
.
sendto
(
MSG
,
0
,
(
HOST
,
PORT
))
class
NonBlockingTCPTests
(
ThreadedTCPSocketTest
):
...
...
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