diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-10 20:18:07 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-10 20:18:07 (GMT) |
commit | a5535f2b36fb718661ef87d7ce8549548cb9e1af (patch) | |
tree | 47dd65df8ad00e702dcc9be5512f44a505686851 /Lib/test/test_docxmlrpc.py | |
parent | a13f4a11294934fca3311809b1c8ec91dc1e6d52 (diff) | |
download | cpython-a5535f2b36fb718661ef87d7ce8549548cb9e1af.zip cpython-a5535f2b36fb718661ef87d7ce8549548cb9e1af.tar.gz cpython-a5535f2b36fb718661ef87d7ce8549548cb9e1af.tar.bz2 |
Fixed doc xml rpc tests and server
Diffstat (limited to 'Lib/test/test_docxmlrpc.py')
-rw-r--r-- | Lib/test/test_docxmlrpc.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index 55c2143..1a056f8 100644 --- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -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>\nto do with <a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>. Case should matter: pEp008 and rFC1952. Things<br>\nthat 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>\nto do with <a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>. Case should matter: pEp008 and rFC1952. Things<br>\nthat 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>\nReturns 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>\nReturns 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>\nReturns a list describing the signature of the method. In the<br>\nabove example, the add method takes two integers as arguments<br>\nand returns a double result.<br>\n <br>\nThis 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>\nReturns 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>\nReturns a list describing the signature of the method. In the<br>\nabove example, the add method takes two integers as arguments<br>\nand returns a double result.<br>\n <br>\nThis 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(): |