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
d778e568
Commit
d778e568
authored
Oct 14, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase timeouts in test_ftplib (for very slow buildbots)
parent
8c8f1ac4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
Lib/test/test_ftplib.py
Lib/test/test_ftplib.py
+13
-13
No files found.
Lib/test/test_ftplib.py
View file @
d778e568
...
...
@@ -102,7 +102,7 @@ class DummyFTPHandler(asynchat.async_chat):
addr
=
list
(
map
(
int
,
arg
.
split
(
','
)))
ip
=
'%d.%d.%d.%d'
%
tuple
(
addr
[:
4
])
port
=
(
addr
[
4
]
*
256
)
+
addr
[
5
]
s
=
socket
.
create_connection
((
ip
,
port
),
timeout
=
2
)
s
=
socket
.
create_connection
((
ip
,
port
),
timeout
=
10
)
self
.
dtp
=
self
.
dtp_handler
(
s
,
baseclass
=
self
)
self
.
push
(
'200 active data connection established'
)
...
...
@@ -110,7 +110,7 @@ class DummyFTPHandler(asynchat.async_chat):
sock
=
socket
.
socket
()
sock
.
bind
((
self
.
socket
.
getsockname
()[
0
],
0
))
sock
.
listen
(
5
)
sock
.
settimeout
(
2
)
sock
.
settimeout
(
10
)
ip
,
port
=
sock
.
getsockname
()[:
2
]
ip
=
ip
.
replace
(
'.'
,
','
);
p1
=
port
/
256
;
p2
=
port
%
256
self
.
push
(
'227 entering passive mode (%s,%d,%d)'
%
(
ip
,
p1
,
p2
))
...
...
@@ -120,7 +120,7 @@ class DummyFTPHandler(asynchat.async_chat):
def
cmd_eprt
(
self
,
arg
):
af
,
ip
,
port
=
arg
.
split
(
arg
[
0
])[
1
:
-
1
]
port
=
int
(
port
)
s
=
socket
.
create_connection
((
ip
,
port
),
timeout
=
2
)
s
=
socket
.
create_connection
((
ip
,
port
),
timeout
=
10
)
self
.
dtp
=
self
.
dtp_handler
(
s
,
baseclass
=
self
)
self
.
push
(
'200 active data connection established'
)
...
...
@@ -128,7 +128,7 @@ class DummyFTPHandler(asynchat.async_chat):
sock
=
socket
.
socket
(
socket
.
AF_INET6
)
sock
.
bind
((
self
.
socket
.
getsockname
()[
0
],
0
))
sock
.
listen
(
5
)
sock
.
settimeout
(
2
)
sock
.
settimeout
(
10
)
port
=
sock
.
getsockname
()[
1
]
self
.
push
(
'229 entering extended passive mode (|||%d|)'
%
port
)
conn
,
addr
=
sock
.
accept
()
...
...
@@ -409,7 +409,7 @@ class TestFTPClass(TestCase):
def
setUp
(
self
):
self
.
server
=
DummyFTPServer
((
HOST
,
0
))
self
.
server
.
start
()
self
.
client
=
ftplib
.
FTP
(
timeout
=
2
)
self
.
client
=
ftplib
.
FTP
(
timeout
=
10
)
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
def
tearDown
(
self
):
...
...
@@ -555,7 +555,7 @@ class TestFTPClass(TestCase):
def
test_makepasv
(
self
):
host
,
port
=
self
.
client
.
makepasv
()
conn
=
socket
.
create_connection
((
host
,
port
),
2
)
conn
=
socket
.
create_connection
((
host
,
port
),
10
)
conn
.
close
()
# IPv4 is in use, just make sure send_epsv has not been used
self
.
assertEqual
(
self
.
server
.
handler_instance
.
last_received_cmd
,
'pasv'
)
...
...
@@ -573,7 +573,7 @@ class TestFTPClass(TestCase):
return
True
# base test
with
ftplib
.
FTP
(
timeout
=
2
)
as
self
.
client
:
with
ftplib
.
FTP
(
timeout
=
10
)
as
self
.
client
:
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
self
.
client
.
sendcmd
(
'noop'
)
self
.
assertTrue
(
is_client_connected
())
...
...
@@ -581,7 +581,7 @@ class TestFTPClass(TestCase):
self
.
assertFalse
(
is_client_connected
())
# QUIT sent inside the with block
with
ftplib
.
FTP
(
timeout
=
2
)
as
self
.
client
:
with
ftplib
.
FTP
(
timeout
=
10
)
as
self
.
client
:
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
self
.
client
.
sendcmd
(
'noop'
)
self
.
client
.
quit
()
...
...
@@ -591,7 +591,7 @@ class TestFTPClass(TestCase):
# force a wrong response code to be sent on QUIT: error_perm
# is expected and the connection is supposed to be closed
try
:
with
ftplib
.
FTP
(
timeout
=
2
)
as
self
.
client
:
with
ftplib
.
FTP
(
timeout
=
10
)
as
self
.
client
:
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
self
.
client
.
sendcmd
(
'noop'
)
self
.
server
.
handler_instance
.
next_response
=
'550 error on quit'
...
...
@@ -639,7 +639,7 @@ class TestIPv6Environment(TestCase):
def
test_makepasv
(
self
):
host
,
port
=
self
.
client
.
makepasv
()
conn
=
socket
.
create_connection
((
host
,
port
),
2
)
conn
=
socket
.
create_connection
((
host
,
port
),
10
)
conn
.
close
()
self
.
assertEqual
(
self
.
server
.
handler_instance
.
last_received_cmd
,
'epsv'
)
...
...
@@ -664,7 +664,7 @@ class TestTLS_FTPClassMixin(TestFTPClass):
def
setUp
(
self
):
self
.
server
=
DummyTLS_FTPServer
((
HOST
,
0
))
self
.
server
.
start
()
self
.
client
=
ftplib
.
FTP_TLS
(
timeout
=
2
)
self
.
client
=
ftplib
.
FTP_TLS
(
timeout
=
10
)
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
# enable TLS
self
.
client
.
auth
()
...
...
@@ -677,7 +677,7 @@ class TestTLS_FTPClass(TestCase):
def
setUp
(
self
):
self
.
server
=
DummyTLS_FTPServer
((
HOST
,
0
))
self
.
server
.
start
()
self
.
client
=
ftplib
.
FTP_TLS
(
timeout
=
2
)
self
.
client
=
ftplib
.
FTP_TLS
(
timeout
=
10
)
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
def
tearDown
(
self
):
...
...
@@ -740,7 +740,7 @@ class TestTLS_FTPClass(TestCase):
self
.
assertRaises
(
ValueError
,
ftplib
.
FTP_TLS
,
certfile
=
CERTFILE
,
keyfile
=
CERTFILE
,
context
=
ctx
)
self
.
client
=
ftplib
.
FTP_TLS
(
context
=
ctx
,
timeout
=
2
)
self
.
client
=
ftplib
.
FTP_TLS
(
context
=
ctx
,
timeout
=
10
)
self
.
client
.
connect
(
self
.
server
.
host
,
self
.
server
.
port
)
self
.
assertNotIsInstance
(
self
.
client
.
sock
,
ssl
.
SSLSocket
)
self
.
client
.
auth
()
...
...
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