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
a5535f2b
Kaydet (Commit)
a5535f2b
authored
Ara 10, 2007
tarafından
Christian Heimes
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed doc xml rpc tests and server
üst
a13f4a11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
DocXMLRPCServer.py
Lib/DocXMLRPCServer.py
+3
-3
test_docxmlrpc.py
Lib/test/test_docxmlrpc.py
+5
-6
No files found.
Lib/DocXMLRPCServer.py
Dosyayı görüntüle @
a5535f2b
...
...
@@ -123,12 +123,12 @@ class ServerHTMLDoc(pydoc.HTMLDoc):
result
=
result
+
'<p>
%
s</p>
\n
'
%
doc
contents
=
[]
method_items
=
methods
.
items
(
)
method_items
=
list
(
methods
.
items
()
)
method_items
.
sort
()
for
key
,
value
in
method_items
:
contents
.
append
(
self
.
docroutine
(
value
,
key
,
funcs
=
fdict
))
result
=
result
+
self
.
bigsection
(
'Methods'
,
'#ffffff'
,
'#eeaa77'
,
pydoc
.
join
(
contents
))
'Methods'
,
'#ffffff'
,
'#eeaa77'
,
''
.
join
(
contents
))
return
result
...
...
@@ -239,7 +239,7 @@ class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
self
.
send_header
(
"Content-type"
,
"text/html"
)
self
.
send_header
(
"Content-length"
,
str
(
len
(
response
)))
self
.
end_headers
()
self
.
wfile
.
write
(
response
)
self
.
wfile
.
write
(
response
.
encode
()
)
# shut down the connection
self
.
wfile
.
flush
()
...
...
Lib/test/test_docxmlrpc.py
Dosyayı görüntüle @
a5535f2b
...
...
@@ -106,7 +106,7 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
response
=
self
.
client
.
getresponse
()
self
.
assert_
(
"""<dl><dt><a name="-<lambda>"><strong><lambda></strong></a>(x, y)</dt></dl>"""
b
"""<dl><dt><a name="-<lambda>"><strong><lambda></strong></a>(x, y)</dt></dl>"""
in
response
.
read
())
def
test_autolinking
(
self
):
...
...
@@ -120,7 +120,7 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
response
=
self
.
client
.
getresponse
()
self
.
assert_
(
# This is ugly ... how can it be made better?
"""<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd><tt>Add two instances together. This follows <a href="http://www.python.org/peps/pep-0008.html">PEP008</a>, but has nothing<br>
\n
to do with <a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>. Case should matter: pEp008 and rFC1952. Things<br>
\n
that start with http and ftp should be auto-linked, too:<br>
\n
<a href="http://google.com">http://google.com</a>.</tt></dd></dl>"""
b
"""<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd><tt>Add two instances together. This follows <a href="http://www.python.org/peps/pep-0008.html">PEP008</a>, but has nothing<br>
\n
to do with <a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>. Case should matter: pEp008 and rFC1952. Things<br>
\n
that start with http and ftp should be auto-linked, too:<br>
\n
<a href="http://google.com">http://google.com</a>.</tt></dd></dl>"""
in
response
.
read
())
def
test_system_methods
(
self
):
...
...
@@ -130,11 +130,10 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
related to that process.
"""
self
.
client
.
request
(
"GET"
,
"/"
)
response
=
self
.
client
.
getresponse
()
response
=
self
.
client
.
getresponse
()
.
read
()
self
.
assert_
(
"""<dl><dt><a name="-system.listMethods"><strong>system.listMethods</strong></a>()</dt><dd><tt><a href="#-system.listMethods">system.listMethods</a>() => [
\'
add
\'
,
\'
subtract
\'
,
\'
multiple
\'
]<br>
\n
<br>
\n
Returns a list of the methods supported by the server.</tt></dd></dl>
\n
<dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodHelp">system.methodHelp</a>(
\'
add
\'
) => "Adds two integers together"<br>
\n
<br>
\n
Returns a string containing documentation for the specified method.</tt></dd></dl>
\n
<dl><dt><a name="-system.methodSignature"><strong>system.methodSignature</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodSignature">system.methodSignature</a>(
\'
add
\'
) => [double, int, int]<br>
\n
<br>
\n
Returns a list describing the signature of the method. In the<br>
\n
above example, the add method takes two integers as arguments<br>
\n
and returns a double result.<br>
\n
<br>
\n
This server does NOT support system.methodSignature.</tt></dd></dl>"""
in
response
.
read
())
b
"""<dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodHelp">system.methodHelp</a>(
\'
add
\'
) => "Adds two integers together"<br>
\n
<br>
\n
Returns a string containing documentation for the specified method.</tt></dd></dl>
\n
<dl><dt><a name="-system.methodSignature"><strong>system.methodSignature</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodSignature">system.methodSignature</a>(
\'
add
\'
) => [double, int, int]<br>
\n
<br>
\n
Returns a list describing the signature of the method. In the<br>
\n
above example, the add method takes two integers as arguments<br>
\n
and returns a double result.<br>
\n
<br>
\n
This server does NOT support system.methodSignature.</tt></dd></dl>
\n
<dl><dt><a name="-test_method"><strong>test_method</strong></a>(arg)</dt><dd><tt>Test method
\'
s docs. This method truly does very little.</tt></dd></dl>"""
in
response
)
def
test_autolink_dotted_methods
(
self
):
"""Test that selfdot values are made strong automatically in the
...
...
@@ -142,7 +141,7 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
self
.
client
.
request
(
"GET"
,
"/"
)
response
=
self
.
client
.
getresponse
()
self
.
assert_
(
"""Try self.<strong>add</strong>, too."""
in
self
.
assert_
(
b
"""Try self.<strong>add</strong>, too."""
in
response
.
read
())
def
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