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
f5c38dad
Kaydet (Commit)
f5c38dad
authored
May 18, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bring test_pydoc up to my high standards (now that I have them)
üst
6cc9fd7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
test_pydoc.py
Lib/test/test_pydoc.py
+17
-19
No files found.
Lib/test/test_pydoc.py
Dosyayı görüntüle @
f5c38dad
...
...
@@ -5,6 +5,7 @@ import re
import
pydoc
import
unittest
import
test.test_support
from
test
import
pydoc_mod
expected_text_pattern
=
\
...
...
@@ -201,16 +202,6 @@ def get_mod_file(module):
return
mod_file
if
mod_file
.
endswith
(
"py"
)
else
mod_file
[:
-
3
]
+
"py"
class
CLINotHereTest
(
unittest
.
TestCase
):
def
test_not_here
(
self
):
missing_module
=
"test.i_am_not_here"
result
=
run_pydoc
(
missing_module
)
expected
=
missing_pattern
%
missing_module
self
.
assertEqual
(
expected
,
result
,
"documentation for missing module found"
)
class
PyDocDocTest
(
unittest
.
TestCase
):
def
test_html_doc
(
self
):
...
...
@@ -228,35 +219,42 @@ class PyDocDocTest(unittest.TestCase):
print_diffs
(
result
,
expected_text
)
self
.
fail
(
"outputs are not equal, see diff above"
)
def
test_not_here
(
self
):
missing_module
=
"test.i_am_not_here"
result
=
run_pydoc
(
missing_module
)
expected
=
missing_pattern
%
missing_module
self
.
assertEqual
(
expected
,
result
,
"documentation for missing module found"
)
class
TestDescriptions
(
unittest
.
TestCase
):
def
test_module
(
self
):
# Check that pydocfodder module can be described
from
test
import
pydocfodder
doc
=
pydoc
.
render_doc
(
pydocfodder
)
assert
"pydocfodder"
in
doc
self
.
assert_
(
"pydocfodder"
in
doc
)
def
test_classic_class
(
self
):
class
C
:
"Classic class"
c
=
C
()
self
.
failUnless
Equal
(
pydoc
.
describe
(
C
),
'class C'
)
self
.
failUnless
Equal
(
pydoc
.
describe
(
c
),
'instance of C'
)
self
.
failUnless
(
'instance of C in module test.test_pydoc'
self
.
assert
Equal
(
pydoc
.
describe
(
C
),
'class C'
)
self
.
assert
Equal
(
pydoc
.
describe
(
c
),
'instance of C'
)
self
.
assert_
(
'instance of C in module test.test_pydoc'
in
pydoc
.
render_doc
(
c
))
def
test_class
(
self
):
class
C
(
object
):
"New-style class"
c
=
C
()
self
.
failUnless
Equal
(
pydoc
.
describe
(
C
),
'class C'
)
self
.
failUnless
Equal
(
pydoc
.
describe
(
c
),
'C'
)
self
.
failUnless
(
'C in module test.test_pydoc object'
self
.
assert
Equal
(
pydoc
.
describe
(
C
),
'class C'
)
self
.
assert
Equal
(
pydoc
.
describe
(
c
),
'C'
)
self
.
assert_
(
'C in module test.test_pydoc object'
in
pydoc
.
render_doc
(
c
))
def
test_main
():
test
.
test_support
.
run_unittest
(
CLINotHereTest
,
PyDocDocTest
,
test
.
test_support
.
run_unittest
(
PyDocDocTest
,
TestDescriptions
)
if
__name__
==
"__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