dhellmann / google-highly-open-participation-psf

Automatically exported from code.google.com/p/google-highly-open-participation-psf
0 stars 0 forks source link

Increase the unit test coverage for the 'SimpleXMLRPCServer' module in the stdlib. #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Measure the number of lines executed by the unit tests included with
Python 2.6 for the 'SimpleXMLRPCServer' module, using figleaf or coverage
(see MeasuringCodeCoverage).  Add new tests that increase the code
coverage for this module to > 95%.  Submit a context diff (see
SubmittingPatches) and text or HTML files containing both the old and
new test coverage results.

Note that for SimpleXMLRPCServer, the '__main__' code is run in a
forked process, so code coverage may not be not accurately recorded.
However, there is still quite a bit of code -- especially
error-handling code -- that needs to be tested.

Completion:

Attach the results of an 'svn diff' (context diff) against the Python
source tree to this task. Also include text containing the old and new
code coverage numbers and a brief description of the changes you've made.

Relevant wiki pages:

 - RecordingTestCoverage
 - HowToTest
 - RunningPythonTests
 - GettingAndCompilingPython

Task duration: please complete this task within 5 days (120 hours) of claiming 
it.

Original issue reported on code.google.com by the.good...@gmail.com on 26 Nov 2007 at 6:26

GoogleCodeExporter commented 9 years ago
I claim this task. But could you give some information about what to test to 
increase
code coverage? I don't know anything, I'm afraid of not completing this task :( 

Original comment by turkay.e...@gmail.com on 2 Dec 2007 at 8:09

GoogleCodeExporter commented 9 years ago
Hi, Eren, I assume you've been able to run the unit tests for 
SimpleXMLRPCServer? 
See Lib/test/test_xmlrpc.py, which do a fine job of setting up the kinds of 
tests you
will need.

You should also take a look at the docs added in Issue 110; they may be useful 
for you!

Note also that neither the figleaf nor coverage.py tools properly handle forking
processes: that is, you may need to put a figleaf.start() and a figleaf.stop() 
and a
figleaf.save() into your server-side code in order to properly get code coverag 
to work.

p.s. Don't worry about failing -- it's not that hard, just several different 
moving
pieces need to work together!

Original comment by the.good...@gmail.com on 2 Dec 2007 at 8:32

GoogleCodeExporter commented 9 years ago
See comments on #171 and #137 - forget about the forking stuff for now, worry 
about
writing a server and client that yield good test coverage of the server.

Original comment by the.good...@gmail.com on 4 Dec 2007 at 12:00

GoogleCodeExporter commented 9 years ago
See

http://groups.google.com/group/ghop-python/browse_frm/thread/19b9b9a49bcccc8e

for some sort of resolution....

Original comment by the.good...@gmail.com on 4 Dec 2007 at 12:21

GoogleCodeExporter commented 9 years ago
This task is due Friday, December 7, 2007 at 08:10:00 UTC.

Original comment by doug.hel...@gmail.com on 4 Dec 2007 at 5:48

GoogleCodeExporter commented 9 years ago
Hi, I completed this task.

Figleaf shows 92.6% but it's actually 94.2% because "if __name__ == '__main__'" 
isn't
called when importing :) I measured it after deleted "if __name__" lines.

I added CGIXMLRPCServerTestCase instance, 404 function, non-existing multicall
function and test for _methodHelp()

Diff is attached,
Cheers

Original comment by turkay.e...@gmail.com on 5 Dec 2007 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago
Nicely done.  Completed.

Original comment by the.good...@gmail.com on 6 Dec 2007 at 8:28

GoogleCodeExporter commented 9 years ago
Thanks :) Just I wonder, could you send me a commit revision and url?

Original comment by turkay.e...@gmail.com on 6 Dec 2007 at 8:37

GoogleCodeExporter commented 9 years ago
Georg will have to do that; I don't have commit access ;)

Original comment by the.good...@gmail.com on 6 Dec 2007 at 8:55

GoogleCodeExporter commented 9 years ago
Committed as rev. 59402!

Original comment by georg.br...@gmail.com on 7 Dec 2007 at 9:07

GoogleCodeExporter commented 9 years ago

Original comment by georg.br...@gmail.com on 12 Dec 2007 at 7:30