[Python-checkins] python/dist/src/Lib/test test_socket.py,1.47,1.48
montanaro@users.sourceforge.net
montanaro@users.sourceforge.net
Thu, 01 Aug 2002 19:19:49 -0700
- Previous message: [Python-checkins] python/nondist/peps pep-0000.txt,1.203,1.204 pep-0256.txt,1.2,1.3 pep-0257.txt,1.4,1.5 pep-0258.txt,1.2,1.3 pep-0287.txt,1.2,1.3
- Next message: [Python-checkins] python/dist/src/PC WinMain.c,1.7,1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv9276
Modified Files:
test_socket.py
Log Message:
modify testGetServByName so it tries a few different protocols. In this day
and age of rampant computer breakins I imagine there are plenty of systems
with telnet disabled. Successful check of at least one getservbyname() call
is required for success
Index: test_socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** test_socket.py 31 Jul 2002 16:08:40 -0000 1.47
--- test_socket.py 2 Aug 2002 02:19:46 -0000 1.48
***************
*** 261,269 ****
"""Testing getservbyname()."""
if hasattr(socket, 'getservbyname'):
! socket.getservbyname('telnet', 'tcp')
! try:
! socket.getservbyname('telnet', 'udp')
! except socket.error:
! pass
def testDefaultTimeout(self):
--- 261,281 ----
"""Testing getservbyname()."""
if hasattr(socket, 'getservbyname'):
! # try a few protocols - not everyone has telnet enabled
! found = 0
! for proto in ("telnet", "ssh", "www", "ftp"):
! try:
! socket.getservbyname(proto, 'tcp')
! found = 1
! break
! except socket.error:
! pass
! try:
! socket.getservbyname(proto, 'udp')
! found = 1
! break
! except socket.error:
! pass
! if not found:
! raise socket.error
def testDefaultTimeout(self):
- Previous message: [Python-checkins] python/nondist/peps pep-0000.txt,1.203,1.204 pep-0256.txt,1.2,1.3 pep-0257.txt,1.4,1.5 pep-0258.txt,1.2,1.3 pep-0287.txt,1.2,1.3
- Next message: [Python-checkins] python/dist/src/PC WinMain.c,1.7,1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]