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
76fdac4c
Unverified
Kaydet (Commit)
76fdac4c
authored
Kas 25, 2017
tarafından
xdegaye
Kaydeden (comit)
GitHub
Kas 25, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-26856: Skip test_pwd on Android until issue 32033 is fixed (GH-4561)
üst
77f51399
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
20 deletions
+7
-20
test_pwd.py
Lib/test/test_pwd.py
+7
-20
No files found.
Lib/test/test_pwd.py
Dosyayı görüntüle @
76fdac4c
...
...
@@ -4,19 +4,11 @@ from test import support
pwd
=
support
.
import_module
(
'pwd'
)
def
_getpwall
():
# Android does not have getpwall.
if
hasattr
(
pwd
,
'getpwall'
):
return
pwd
.
getpwall
()
elif
hasattr
(
pwd
,
'getpwuid'
):
return
[
pwd
.
getpwuid
(
0
)]
else
:
return
[]
@unittest.skipUnless
(
hasattr
(
pwd
,
'getpwall'
),
'Does not have getpwall()'
)
class
PwdTest
(
unittest
.
TestCase
):
def
test_values
(
self
):
entries
=
_
getpwall
()
entries
=
pwd
.
getpwall
()
for
e
in
entries
:
self
.
assertEqual
(
len
(
e
),
7
)
...
...
@@ -42,7 +34,7 @@ class PwdTest(unittest.TestCase):
# and check afterwards (done in test_values_extended)
def
test_values_extended
(
self
):
entries
=
_
getpwall
()
entries
=
pwd
.
getpwall
()
entriesbyname
=
{}
entriesbyuid
=
{}
...
...
@@ -66,13 +58,12 @@ class PwdTest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
pwd
.
getpwuid
,
3.14
)
self
.
assertRaises
(
TypeError
,
pwd
.
getpwnam
)
self
.
assertRaises
(
TypeError
,
pwd
.
getpwnam
,
42
)
if
hasattr
(
pwd
,
'getpwall'
):
self
.
assertRaises
(
TypeError
,
pwd
.
getpwall
,
42
)
self
.
assertRaises
(
TypeError
,
pwd
.
getpwall
,
42
)
# try to get some errors
bynames
=
{}
byuids
=
{}
for
(
n
,
p
,
u
,
g
,
gecos
,
d
,
s
)
in
_
getpwall
():
for
(
n
,
p
,
u
,
g
,
gecos
,
d
,
s
)
in
pwd
.
getpwall
():
bynames
[
n
]
=
u
byuids
[
u
]
=
n
...
...
@@ -106,17 +97,13 @@ class PwdTest(unittest.TestCase):
# loop, say), pwd.getpwuid() might still be able to find data for that
# uid. Using sys.maxint may provoke the same problems, but hopefully
# it will be a more repeatable failure.
# Android accepts a very large span of uids including sys.maxsize and
# -1; it raises KeyError with 1 or 2 for example.
fakeuid
=
sys
.
maxsize
self
.
assertNotIn
(
fakeuid
,
byuids
)
if
not
support
.
is_android
:
self
.
assertRaises
(
KeyError
,
pwd
.
getpwuid
,
fakeuid
)
self
.
assertRaises
(
KeyError
,
pwd
.
getpwuid
,
fakeuid
)
# -1 shouldn't be a valid uid because it has a special meaning in many
# uid-related functions
if
not
support
.
is_android
:
self
.
assertRaises
(
KeyError
,
pwd
.
getpwuid
,
-
1
)
self
.
assertRaises
(
KeyError
,
pwd
.
getpwuid
,
-
1
)
# should be out of uid_t range
self
.
assertRaises
(
KeyError
,
pwd
.
getpwuid
,
2
**
128
)
self
.
assertRaises
(
KeyError
,
pwd
.
getpwuid
,
-
2
**
128
)
...
...
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