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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
test_nis
Lib/test/output/test_nis
+0
-2
test_nis.py
Lib/test/test_nis.py
+19
-17
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
import
nis
print
'nis.maps()'
class
NisTests
(
unittest
.
TestCase
):
try
:
def
test_maps
(
self
):
try
:
maps
=
nis
.
maps
()
maps
=
nis
.
maps
()
except
nis
.
error
,
msg
:
except
nis
.
error
,
msg
:
# NIS is probably not active, so this test isn't useful
# NIS is probably not active, so this test isn't useful
if
verbose
:
if
verbose
:
raise
TestFailed
,
msg
self
.
fail
(
"(failing because of verbose mode)
%
s"
%
msg
)
# only do this if running under the regression suite
return
raise
TestSkipped
,
msg
try
:
try
:
# On some systems, this map is only accessible to the
# On some systems, this map is only accessible to the
# super user
# super user
maps
.
remove
(
"passwd.adjunct.byname"
)
maps
.
remove
(
"passwd.adjunct.byname"
)
except
ValueError
:
except
ValueError
:
pass
pass
done
=
0
done
=
0
for
nismap
in
maps
:
for
nismap
in
maps
:
if
verbose
:
print
nismap
mapping
=
nis
.
cat
(
nismap
)
mapping
=
nis
.
cat
(
nismap
)
for
k
,
v
in
mapping
.
items
():
for
k
,
v
in
mapping
.
items
():
if
verbose
:
print
' '
,
k
,
v
if
not
k
:
if
not
k
:
continue
continue
if
nis
.
match
(
k
,
nismap
)
!=
v
:
if
nis
.
match
(
k
,
nismap
)
!=
v
:
print
"NIS match failed for key `
%
s' in map `
%
s'"
%
(
k
,
nismap
)
self
.
fail
(
"NIS match failed for key `
%
s' in map `
%
s'"
%
(
k
,
nismap
)
)
else
:
else
:
# just test the one key, otherwise this test could take a
# just test the one key, otherwise this test could take a
# very long time
# very long time
...
@@ -37,3 +33,9 @@ for nismap in maps:
...
@@ -37,3 +33,9 @@ for nismap in maps:
break
break
if
done
:
if
done
:
break
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