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
850b2be6
Kaydet (Commit)
850b2be6
authored
Eki 29, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert test_nis to unittest.
üst
eecce795
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
37 deletions
+37
-37
test_nis
Lib/test/output/test_nis
+0
-2
test_nis.py
Lib/test/test_nis.py
+37
-35
No files found.
Lib/test/output/test_nis
deleted
100644 → 0
Dosyayı görüntüle @
eecce795
test_nis
nis.maps()
Lib/test/test_nis.py
Dosyayı görüntüle @
850b2be6
from
test.test_support
import
verbose
,
TestFailed
,
TestSkipped
from
test.test_support
import
verbose
,
run_unittest
import
unittest
import
nis
print
'nis.maps()'
try
:
maps
=
nis
.
maps
()
except
nis
.
error
,
msg
:
# NIS is probably not active, so this test isn't useful
if
verbose
:
raise
TestFailed
,
msg
# only do this if running under the regression suite
raise
TestSkipped
,
msg
class
NisTests
(
unittest
.
TestCase
):
def
test_maps
(
self
):
try
:
maps
=
nis
.
maps
()
except
nis
.
error
,
msg
:
# NIS is probably not active, so this test isn't useful
if
verbose
:
self
.
fail
(
"(failing because of verbose mode)
%
s"
%
msg
)
return
try
:
# On some systems, this map is only accessible to the
# super user
maps
.
remove
(
"passwd.adjunct.byname"
)
except
ValueError
:
pass
try
:
# On some systems, this map is only accessible to the
# super user
maps
.
remove
(
"passwd.adjunct.byname"
)
except
ValueError
:
pass
done
=
0
for
nismap
in
maps
:
mapping
=
nis
.
cat
(
nismap
)
for
k
,
v
in
mapping
.
items
():
if
not
k
:
continue
if
nis
.
match
(
k
,
nismap
)
!=
v
:
self
.
fail
(
"NIS match failed for key `
%
s' in map `
%
s'"
%
(
k
,
nismap
))
else
:
# just test the one key, otherwise this test could take a
# very long time
done
=
1
break
if
done
:
break
done
=
0
for
nismap
in
maps
:
if
verbose
:
print
nismap
mapping
=
nis
.
cat
(
nismap
)
for
k
,
v
in
mapping
.
items
():
if
verbose
:
print
' '
,
k
,
v
if
not
k
:
continue
if
nis
.
match
(
k
,
nismap
)
!=
v
:
print
"NIS match failed for key `
%
s' in map `
%
s'"
%
(
k
,
nismap
)
else
:
# just test the one key, otherwise this test could take a
# very long time
done
=
1
break
if
done
:
break
def
test_main
():
run_unittest
(
NisTests
)
if
__name__
==
'__main__'
:
test_main
()
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