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
d59240de
Kaydet (Commit)
d59240de
authored
May 02, 2012
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #14698: Make test_posix more robust when the current UID doesn't have an
associated pwd entry.
üst
67880cc9
e8a255a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
test_posix.py
Lib/test/test_posix.py
+9
-3
No files found.
Lib/test/test_posix.py
Dosyayı görüntüle @
d59240de
...
...
@@ -108,7 +108,11 @@ class PosixTester(unittest.TestCase):
# If a non-privileged user invokes it, it should fail with OSError
# EPERM.
if
os
.
getuid
()
!=
0
:
name
=
pwd
.
getpwuid
(
posix
.
getuid
())
.
pw_name
try
:
name
=
pwd
.
getpwuid
(
posix
.
getuid
())
.
pw_name
except
KeyError
:
# the current UID may not have a pwd entry
raise
unittest
.
SkipTest
(
"need a pwd entry"
)
try
:
posix
.
initgroups
(
name
,
13
)
except
OSError
as
e
:
...
...
@@ -624,8 +628,9 @@ class PosixTester(unittest.TestCase):
def
test_getgrouplist
(
self
):
with
os
.
popen
(
'id -G'
)
as
idg
:
groups
=
idg
.
read
()
.
strip
()
ret
=
idg
.
close
()
if
not
groups
:
if
ret
!=
0
or
not
groups
:
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
self
.
assertEqual
(
...
...
@@ -637,8 +642,9 @@ class PosixTester(unittest.TestCase):
def
test_getgroups
(
self
):
with
os
.
popen
(
'id -G'
)
as
idg
:
groups
=
idg
.
read
()
.
strip
()
ret
=
idg
.
close
()
if
not
groups
:
if
ret
!=
0
or
not
groups
:
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
# 'id -G' and 'os.getgroups()' should return the same
...
...
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