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
813cec9a
Kaydet (Commit)
813cec9a
authored
May 16, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
test_fileno(): Skip this test on Windows.
üst
047c54bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
test_urllibnet.py
Lib/test/test_urllibnet.py
+17
-13
No files found.
Lib/test/test_urllibnet.py
Dosyayı görüntüle @
813cec9a
...
...
@@ -25,17 +25,17 @@ class URLTimeoutTest(unittest.TestCase):
class
urlopenNetworkTests
(
unittest
.
TestCase
):
"""Tests urllib.urlopen using the network.
These tests are not exhaustive. Assuming that testing using files does a
good job overall of some of the basic interface features. There are no
tests exercising the optional 'data' and 'proxies' arguments. No tests
for transparent redirection have been written.
setUp is not used for always constructing a connection to
http://www.python.org/ since there a few tests that don't use that address
and making a connection is expensive enough to warrant minimizing unneeded
connections.
"""
def
test_basic
(
self
):
...
...
@@ -84,16 +84,20 @@ class urlopenNetworkTests(unittest.TestCase):
self
.
assertEqual
(
gotten_url
,
URL
)
def
test_fileno
(
self
):
if
(
sys
.
platform
in
(
'win32'
,)
or
not
hasattr
(
os
,
'fdopen'
)):
# On Windows, socket handles are not file descriptors; this
# test can't pass on Windows.
return
# Make sure fd returned by fileno is valid.
if
hasattr
(
os
,
'fdopen'
):
open_url
=
urllib
.
urlopen
(
"http://www.python.org/"
)
fd
=
open_url
.
fileno
()
FILE
=
os
.
fdopen
(
fd
)
try
:
self
.
assert_
(
FILE
.
read
(),
"reading from file created using fd "
"returned by fileno failed"
)
finally
:
FILE
.
close
()
open_url
=
urllib
.
urlopen
(
"http://www.python.org/"
)
fd
=
open_url
.
fileno
()
FILE
=
os
.
fdopen
(
fd
)
try
:
self
.
assert_
(
FILE
.
read
(),
"reading from file created using fd "
"returned by fileno failed"
)
finally
:
FILE
.
close
()
def
test_bad_address
(
self
):
# Make sure proper exception is raised when connecting to a bogus
...
...
@@ -136,7 +140,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
os
.
unlink
(
file_location
)
self
.
assert_
(
isinstance
(
header
,
mimetools
.
Message
),
"header is not an instance of mimetools.Message"
)
def
test_main
():
...
...
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