Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ae469312
Kaydet (Commit)
ae469312
authored
Agu 22, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Standardize behavior: no docstrings in test functions.
üst
9eee554b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
test_timeout.py
Lib/test/test_timeout.py
+14
-14
test_whichdb.py
Lib/test/test_whichdb.py
+3
-4
No files found.
Lib/test/test_timeout.py
Dosyayı görüntüle @
ae469312
...
...
@@ -17,12 +17,12 @@ class CreationTestCase(unittest.TestCase):
self
.
sock
.
close
()
def
testObjectCreation
(
self
):
"Test Socket creation"
# Test Socket creation
self
.
assertEqual
(
self
.
sock
.
gettimeout
(),
None
,
"timeout not disabled by default"
)
def
testFloatReturnValue
(
self
):
"Test return value of gettimeout()"
# Test return value of gettimeout()
self
.
sock
.
settimeout
(
7.345
)
self
.
assertEqual
(
self
.
sock
.
gettimeout
(),
7.345
)
...
...
@@ -33,7 +33,7 @@ class CreationTestCase(unittest.TestCase):
self
.
assertEqual
(
self
.
sock
.
gettimeout
(),
None
)
def
testReturnType
(
self
):
"Test return type of gettimeout()"
# Test return type of gettimeout()
self
.
sock
.
settimeout
(
1
)
self
.
assertEqual
(
type
(
self
.
sock
.
gettimeout
()),
type
(
1.0
))
...
...
@@ -41,7 +41,7 @@ class CreationTestCase(unittest.TestCase):
self
.
assertEqual
(
type
(
self
.
sock
.
gettimeout
()),
type
(
1.0
))
def
testTypeCheck
(
self
):
"Test type checking by settimeout()"
# Test type checking by settimeout()
self
.
sock
.
settimeout
(
0
)
self
.
sock
.
settimeout
(
0L
)
self
.
sock
.
settimeout
(
0.0
)
...
...
@@ -54,13 +54,13 @@ class CreationTestCase(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
self
.
sock
.
settimeout
,
0
j
)
def
testRangeCheck
(
self
):
"Test range checking by settimeout()"
# Test range checking by settimeout()
self
.
assertRaises
(
ValueError
,
self
.
sock
.
settimeout
,
-
1
)
self
.
assertRaises
(
ValueError
,
self
.
sock
.
settimeout
,
-
1L
)
self
.
assertRaises
(
ValueError
,
self
.
sock
.
settimeout
,
-
1.0
)
def
testTimeoutThenBlocking
(
self
):
"Test settimeout() followed by setblocking()"
# Test settimeout() followed by setblocking()
self
.
sock
.
settimeout
(
10
)
self
.
sock
.
setblocking
(
1
)
self
.
assertEqual
(
self
.
sock
.
gettimeout
(),
None
)
...
...
@@ -74,7 +74,7 @@ class CreationTestCase(unittest.TestCase):
self
.
assertEqual
(
self
.
sock
.
gettimeout
(),
None
)
def
testBlockingThenTimeout
(
self
):
"Test setblocking() followed by settimeout()"
# Test setblocking() followed by settimeout()
self
.
sock
.
setblocking
(
0
)
self
.
sock
.
settimeout
(
1
)
self
.
assertEqual
(
self
.
sock
.
gettimeout
(),
1
)
...
...
@@ -98,7 +98,7 @@ class TimeoutTestCase(unittest.TestCase):
self
.
sock
.
close
()
def
testConnectTimeout
(
self
):
"Test connect() timeout"
# Test connect() timeout
_timeout
=
0.02
self
.
sock
.
settimeout
(
_timeout
)
...
...
@@ -113,7 +113,7 @@ class TimeoutTestCase(unittest.TestCase):
%
(
_delta
,
self
.
fuzz
,
_timeout
))
def
testRecvTimeout
(
self
):
"Test recv() timeout"
# Test recv() timeout
_timeout
=
0.02
self
.
sock
.
connect
(
self
.
addr_remote
)
self
.
sock
.
settimeout
(
_timeout
)
...
...
@@ -128,7 +128,7 @@ class TimeoutTestCase(unittest.TestCase):
%
(
_delta
,
self
.
fuzz
,
_timeout
))
def
testAcceptTimeout
(
self
):
"Test accept() timeout"
# Test accept() timeout
_timeout
=
2
self
.
sock
.
settimeout
(
_timeout
)
self
.
sock
.
bind
(
self
.
addr_local
)
...
...
@@ -144,7 +144,7 @@ class TimeoutTestCase(unittest.TestCase):
%
(
_delta
,
self
.
fuzz
,
_timeout
))
def
testRecvfromTimeout
(
self
):
"Test recvfrom() timeout"
# Test recvfrom() timeout
_timeout
=
2
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
self
.
sock
.
settimeout
(
_timeout
)
...
...
@@ -160,17 +160,17 @@ class TimeoutTestCase(unittest.TestCase):
%
(
_delta
,
self
.
fuzz
,
_timeout
))
def
testSend
(
self
):
"Test send() timeout"
# Test send() timeout
# couldn't figure out how to test it
pass
def
testSendto
(
self
):
"Test sendto() timeout"
# Test sendto() timeout
# couldn't figure out how to test it
pass
def
testSendall
(
self
):
"Test sendall() timeout"
# Test sendall() timeout
# couldn't figure out how to test it
pass
...
...
Lib/test/test_whichdb.py
Dosyayı görüntüle @
ae469312
...
...
@@ -42,10 +42,9 @@ for name in anydbm._names:
except
ImportError
:
continue
def
test_whichdb_name
(
self
,
name
=
name
,
mod
=
mod
):
"""Check whether whichdb correctly guesses module name
for databases opened with module mod.
"""
def
test_whichdb_name
(
self
,
name
=
name
,
mod
=
mod
):
# Check whether whichdb correctly guesses module name
# for databases opened with module mod.
f
=
mod
.
open
(
_fname
,
'c'
)
f
[
"1"
]
=
"1"
f
.
close
()
...
...
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