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
5eb55599
Kaydet (Commit)
5eb55599
authored
May 25, 2011
tarafından
Tarek Ziade
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12180: Fixed a few remaining errors in test_packaging when no threading.
üst
d2780aed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
7 deletions
+39
-7
support.py
Lib/packaging/tests/support.py
+9
-0
test_install.py
Lib/packaging/tests/test_install.py
+3
-2
test_pypi_dist.py
Lib/packaging/tests/test_pypi_dist.py
+3
-2
test_pypi_simple.py
Lib/packaging/tests/test_pypi_simple.py
+21
-3
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/packaging/tests/support.py
Dosyayı görüntüle @
5eb55599
...
...
@@ -253,6 +253,15 @@ def create_distribution(configfiles=()):
return
d
def
fake_dec
(
*
args
,
**
kw
):
"""Fake decorator"""
def
_wrap
(
func
):
def
__wrap
(
*
args
,
**
kw
):
return
func
(
*
args
,
**
kw
)
return
__wrap
return
_wrap
try
:
from
test.support
import
skip_unless_symlink
except
ImportError
:
...
...
Lib/packaging/tests/test_install.py
Dosyayı görüntüle @
5eb55599
...
...
@@ -6,13 +6,14 @@ from packaging import install
from
packaging.pypi.xmlrpc
import
Client
from
packaging.metadata
import
Metadata
from
packaging.tests.support
import
LoggingCatcher
,
TempdirManager
,
unittest
from
packaging.tests.support
import
(
LoggingCatcher
,
TempdirManager
,
unittest
,
fake_dec
)
try
:
import
threading
from
packaging.tests.pypi_server
import
use_xmlrpc_server
except
ImportError
:
threading
=
None
use_xmlrpc_server
=
None
use_xmlrpc_server
=
fake_dec
class
InstalledDist
:
...
...
Lib/packaging/tests/test_pypi_dist.py
Dosyayı görüntüle @
5eb55599
...
...
@@ -7,12 +7,13 @@ from packaging.pypi.dist import (ReleaseInfo, ReleasesList, DistInfo,
from
packaging.pypi.errors
import
HashDoesNotMatch
,
UnsupportedHashName
from
packaging.tests
import
unittest
from
packaging.tests.support
import
TempdirManager
,
requires_zlib
from
packaging.tests.support
import
TempdirManager
,
requires_zlib
,
fake_dec
try
:
import
threading
from
packaging.tests.pypi_server
import
use_pypi_server
except
ImportError
:
threading
=
use_pypi_server
=
None
threading
=
None
use_pypi_server
=
fake_dec
def
Dist
(
*
args
,
**
kwargs
):
...
...
Lib/packaging/tests/test_pypi_simple.py
Dosyayı görüntüle @
5eb55599
...
...
@@ -10,9 +10,19 @@ import urllib.request
from
packaging.pypi.simple
import
Crawler
from
packaging.tests
import
unittest
from
packaging.tests.support
import
TempdirManager
,
LoggingCatcher
from
packaging.tests.pypi_server
import
(
use_pypi_server
,
PyPIServer
,
PYPI_DEFAULT_STATIC_PATH
)
from
packaging.tests.support
import
(
TempdirManager
,
LoggingCatcher
,
fake_dec
)
try
:
import
_thread
from
packaging.tests.pypi_server
import
(
use_pypi_server
,
PyPIServer
,
PYPI_DEFAULT_STATIC_PATH
)
except
ImportError
:
_thread
=
None
use_pypi_server
=
fake_dec
PYPI_DEFAULT_STATIC_PATH
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'pypiserver'
)
class
SimpleCrawlerTestCase
(
TempdirManager
,
...
...
@@ -28,6 +38,7 @@ class SimpleCrawlerTestCase(TempdirManager,
return
Crawler
(
server
.
full_address
+
base_url
,
*
args
,
**
kwargs
)
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
()
def
test_bad_urls
(
self
,
server
):
crawler
=
Crawler
()
...
...
@@ -84,6 +95,7 @@ class SimpleCrawlerTestCase(TempdirManager,
'http://www.famfamfam.com/">'
)
crawler
.
_process_url
(
url
,
page
)
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
(
"test_found_links"
)
def
test_found_links
(
self
,
server
):
# Browse the index, asking for a specified release version
...
...
@@ -139,6 +151,7 @@ class SimpleCrawlerTestCase(TempdirManager,
self
.
assertTrue
(
crawler
.
_is_browsable
(
"http://pypi.example.org/a/path"
))
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
(
"with_externals"
)
def
test_follow_externals
(
self
,
server
):
# Include external pages
...
...
@@ -149,6 +162,7 @@ class SimpleCrawlerTestCase(TempdirManager,
self
.
assertIn
(
server
.
full_address
+
"/external/external.html"
,
crawler
.
_processed_urls
)
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
(
"with_real_externals"
)
def
test_restrict_hosts
(
self
,
server
):
# Only use a list of allowed hosts is possible
...
...
@@ -159,6 +173,7 @@ class SimpleCrawlerTestCase(TempdirManager,
self
.
assertNotIn
(
server
.
full_address
+
"/external/external.html"
,
crawler
.
_processed_urls
)
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
(
static_filesystem_paths
=
[
"with_externals"
],
static_uri_paths
=
[
"simple"
,
"external"
])
def
test_links_priority
(
self
,
server
):
...
...
@@ -192,6 +207,7 @@ class SimpleCrawlerTestCase(TempdirManager,
releases
[
0
]
.
dists
[
'sdist'
]
.
url
[
'hashval'
])
self
.
assertEqual
(
'md5'
,
releases
[
0
]
.
dists
[
'sdist'
]
.
url
[
'hashname'
])
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
(
static_filesystem_paths
=
[
"with_norel_links"
],
static_uri_paths
=
[
"simple"
,
"external"
])
def
test_not_scan_all_links
(
self
,
server
):
...
...
@@ -217,6 +233,7 @@ class SimpleCrawlerTestCase(TempdirManager,
self
.
assertIn
(
"
%
s/foobar-2.0.tar.gz"
%
server
.
full_address
,
crawler
.
_processed_urls
)
# linked from external homepage (rel)
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
def
test_uses_mirrors
(
self
):
# When the main repository seems down, try using the given mirrors"""
server
=
PyPIServer
(
"foo_bar_baz"
)
...
...
@@ -314,6 +331,7 @@ class SimpleCrawlerTestCase(TempdirManager,
self
.
assertIn
(
'http://example.org/some/simpleurl'
,
found_links
)
self
.
assertIn
(
'http://example.org/some/download'
,
found_links
)
@unittest.skipIf
(
_thread
is
None
,
'needs threads'
)
@use_pypi_server
(
"project_list"
)
def
test_search_projects
(
self
,
server
):
# we can search the index for some projects, on their names
...
...
Misc/NEWS
Dosyayı görüntüle @
5eb55599
...
...
@@ -161,6 +161,9 @@ Core and Builtins
Library
-------
- Issue #12180: Fixed a few remaining errors in test_packaging when no
threading.
- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
...
...
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