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
052a02be
Kaydet (Commit)
052a02be
authored
Agu 17, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add tests for mknod() and mkfifo() #9569
üst
82c48852
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
test_posix.py
Lib/test/test_posix.py
+23
-0
No files found.
Lib/test/test_posix.py
Dosyayı görüntüle @
052a02be
...
...
@@ -11,6 +11,7 @@ import time
import
os
import
pwd
import
shutil
import
stat
import
unittest
import
warnings
...
...
@@ -199,6 +200,28 @@ class PosixTester(unittest.TestCase):
if
hasattr
(
posix
,
'stat'
):
self
.
assertTrue
(
posix
.
stat
(
support
.
TESTFN
))
@unittest.skipUnless
(
hasattr
(
posix
,
'mkfifo'
),
"don't have mkfifo()"
)
def
test_mkfifo
(
self
):
support
.
unlink
(
support
.
TESTFN
)
posix
.
mkfifo
(
support
.
TESTFN
,
stat
.
S_IRUSR
|
stat
.
S_IWUSR
)
self
.
assertTrue
(
stat
.
S_ISFIFO
(
posix
.
stat
(
support
.
TESTFN
)
.
st_mode
))
@unittest.skipUnless
(
hasattr
(
posix
,
'mknod'
)
and
hasattr
(
stat
,
'S_IFIFO'
),
"don't have mknod()/S_IFIFO"
)
def
test_mknod
(
self
):
# Test using mknod() to create a FIFO (the only use specified
# by POSIX).
support
.
unlink
(
support
.
TESTFN
)
mode
=
stat
.
S_IFIFO
|
stat
.
S_IRUSR
|
stat
.
S_IWUSR
try
:
posix
.
mknod
(
support
.
TESTFN
,
mode
,
0
)
except
OSError
as
e
:
# Some old systems don't allow unprivileged users to use
# mknod(), or only support creating device nodes.
self
.
assertIn
(
e
.
errno
,
(
errno
.
EPERM
,
errno
.
EINVAL
))
else
:
self
.
assertTrue
(
stat
.
S_ISFIFO
(
posix
.
stat
(
support
.
TESTFN
)
.
st_mode
))
def
_test_all_chown_common
(
self
,
chown_func
,
first_param
):
"""Common code for chown, fchown and lchown tests."""
if
os
.
getuid
()
==
0
:
...
...
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