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
566c470e
Kaydet (Commit)
566c470e
authored
Agu 16, 2013
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #1666318: Add a test that shutil.copytree() retains directory permissions.
Patch by Catherine Devlin.
üst
53e5b5e5
ac601601
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
test_shutil.py
Lib/test/test_shutil.py
+26
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_shutil.py
Dosyayı görüntüle @
566c470e
...
@@ -727,6 +727,32 @@ class TestShutil(unittest.TestCase):
...
@@ -727,6 +727,32 @@ class TestShutil(unittest.TestCase):
shutil
.
rmtree
(
src_dir
)
shutil
.
rmtree
(
src_dir
)
shutil
.
rmtree
(
os
.
path
.
dirname
(
dst_dir
))
shutil
.
rmtree
(
os
.
path
.
dirname
(
dst_dir
))
def
test_copytree_retains_permissions
(
self
):
tmp_dir
=
tempfile
.
mkdtemp
()
src_dir
=
os
.
path
.
join
(
tmp_dir
,
'source'
)
os
.
mkdir
(
src_dir
)
dst_dir
=
os
.
path
.
join
(
tmp_dir
,
'destination'
)
self
.
addCleanup
(
shutil
.
rmtree
,
tmp_dir
)
os
.
chmod
(
src_dir
,
0
o777
)
write_file
((
src_dir
,
'permissive.txt'
),
'123'
)
os
.
chmod
(
os
.
path
.
join
(
src_dir
,
'permissive.txt'
),
0
o777
)
write_file
((
src_dir
,
'restrictive.txt'
),
'456'
)
os
.
chmod
(
os
.
path
.
join
(
src_dir
,
'restrictive.txt'
),
0
o600
)
restrictive_subdir
=
tempfile
.
mkdtemp
(
dir
=
src_dir
)
os
.
chmod
(
restrictive_subdir
,
0
o600
)
shutil
.
copytree
(
src_dir
,
dst_dir
)
self
.
assertEquals
(
os
.
stat
(
src_dir
)
.
st_mode
,
os
.
stat
(
dst_dir
)
.
st_mode
)
self
.
assertEquals
(
os
.
stat
(
os
.
path
.
join
(
src_dir
,
'permissive.txt'
))
.
st_mode
,
os
.
stat
(
os
.
path
.
join
(
dst_dir
,
'permissive.txt'
))
.
st_mode
)
self
.
assertEquals
(
os
.
stat
(
os
.
path
.
join
(
src_dir
,
'restrictive.txt'
))
.
st_mode
,
os
.
stat
(
os
.
path
.
join
(
dst_dir
,
'restrictive.txt'
))
.
st_mode
)
restrictive_subdir_dst
=
os
.
path
.
join
(
dst_dir
,
os
.
path
.
split
(
restrictive_subdir
)[
1
])
self
.
assertEquals
(
os
.
stat
(
restrictive_subdir
)
.
st_mode
,
os
.
stat
(
restrictive_subdir_dst
)
.
st_mode
)
@unittest.skipUnless
(
hasattr
(
os
,
'link'
),
'requires os.link'
)
@unittest.skipUnless
(
hasattr
(
os
,
'link'
),
'requires os.link'
)
def
test_dont_copy_file_onto_link_to_itself
(
self
):
def
test_dont_copy_file_onto_link_to_itself
(
self
):
# Temporarily disable test on Windows.
# Temporarily disable test on Windows.
...
...
Misc/NEWS
Dosyayı görüntüle @
566c470e
...
@@ -682,6 +682,9 @@ Library
...
@@ -682,6 +682,9 @@ Library
Tests
Tests
-----
-----
- Issue #1666318: Add a test that shutil.copytree() retains directory
permissions. Patch by Catherine Devlin.
- Issue #18273: move the tests in Lib/test/json_tests to Lib/test/test_json
- Issue #18273: move the tests in Lib/test/json_tests to Lib/test/test_json
and make them discoverable by unittest. Patch by Zachary Ware.
and make them discoverable by unittest. Patch by Zachary Ware.
...
...
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