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
d9aab519
Kaydet (Commit)
d9aab519
authored
Ock 24, 2009
tarafından
Kristján Valur Jónsson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a test for UNC import paths, see issue 3677
üst
92cb4384
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
test_import.py
Lib/test/test_import.py
+21
-0
No files found.
Lib/test/test_import.py
Dosyayı görüntüle @
d9aab519
...
...
@@ -346,6 +346,27 @@ class PathsTests(unittest.TestCase):
self
.
assertEqual
(
mod
.
testdata
,
'test_trailing_slash'
)
unload
(
"test_trailing_slash"
)
# http://bugs.python.org/issue3677
def
_test_UNC_path
(
self
):
f
=
open
(
os
.
path
.
join
(
self
.
path
,
'test_trailing_slash.py'
),
'w'
)
f
.
write
(
"testdata = 'test_trailing_slash'"
)
f
.
close
()
#create the UNC path, like \\myhost\c$\foo\bar
path
=
os
.
path
.
abspath
(
self
.
path
)
import
socket
hn
=
socket
.
gethostname
()
drive
=
path
[
0
]
unc
=
"
\\\\
%
s
\\
%
s$"
%
(
hn
,
drive
)
unc
+=
path
[
2
:]
sys
.
path
.
append
(
path
)
mod
=
__import__
(
"test_trailing_slash"
)
self
.
assertEqual
(
mod
.
testdata
,
'test_trailing_slash'
)
unload
(
"test_trailing_slash"
)
if
sys
.
platform
==
"win32"
:
test_UNC_path
=
_test_UNC_path
class
RelativeImport
(
unittest
.
TestCase
):
def
tearDown
(
self
):
try
:
...
...
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