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 'SimpleHTTPServer' server in the stdlib. #137

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 'SimpleHTTPServer' 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 SimpleHTTPServer, the 'test()' function 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.

Original comment by m.ottene...@gmail.com on 1 Dec 2007 at 9:22

GoogleCodeExporter commented 9 years ago

Original comment by doug.hel...@gmail.com on 1 Dec 2007 at 9:46

GoogleCodeExporter commented 9 years ago
Did you manage to get coverage/figleaf working?

Original comment by jdzolo...@gmail.com on 4 Dec 2007 at 9:18

GoogleCodeExporter commented 9 years ago
See

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

for resolution.  Thanks for sticking with!

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

GoogleCodeExporter commented 9 years ago
This task is due Thursday, December 6, 2007 at 21:25:00 UTC.

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

GoogleCodeExporter commented 9 years ago
I need a bit more time. Here is what I have currently:
http://rafb.net/p/6uWYd117.html

Original comment by m.ottene...@gmail.com on 6 Dec 2007 at 5:49

GoogleCodeExporter commented 9 years ago

Original comment by doug.hel...@gmail.com on 7 Dec 2007 at 1:27

GoogleCodeExporter commented 9 years ago
Your test_get() seems to be retrieving the temporary file that does exist 
without
checking the response code.  test_invalid_request() doesn't seem to use 
self.connection.

Other than that, it looks like good progress!

Original comment by doug.hel...@gmail.com on 7 Dec 2007 at 1:46

GoogleCodeExporter commented 9 years ago
Setting Due date to include 3-day grace period. If you think you'll not 
complete the
task until December 9, let us know.

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

GoogleCodeExporter commented 9 years ago

Original comment by the.good...@gmail.com on 8 Dec 2007 at 10:14

GoogleCodeExporter commented 9 years ago
Hi! I attached the diff. You can also take a look at the test here. If you have 
any
suggestions pls just tell me.

I cannot tell you the code coverage at the moment cause coverage.py suddenly 
refuses
to work. But last time I meausured coverage was 89%.

I'm measuring like this:
./python.exe coverage-2.77/coverage.py  -e
./python.exe  coverage-2.77/coverage.py -x Lib/test/test_simplehttpserver.py
./python.exe  coverage-2.77/coverage.py -r Lib/SimpleHTTPServer.py
Name                   Stmts   Exec  Cover
------------------------------------------
Lib/SimpleHTTPServer     116      0     0%

BTW: I'm not on windows but on OS X. Strange python.exe...

Original comment by m.ottene...@gmail.com on 9 Dec 2007 at 7:08

Attachments:

GoogleCodeExporter commented 9 years ago
I have five comments:

1) Your test will only work on Unixish systems. You should use os.path for 
directory
operations (os.path.join, os.path.sep etc.), and you shouldn't use /tmp as a
hardcoded temporary directory. mkdtemp should figure out itself where to put 
the temp
dir.
2) Please break the code at 80 chars per line.
5) TABS!!!111

Original comment by georg.br...@gmail.com on 9 Dec 2007 at 8:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Now with the correct Diff

Original comment by m.ottene...@gmail.com on 9 Dec 2007 at 9:44

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by m.ottene...@gmail.com on 9 Dec 2007 at 9:56

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, I'll make sure it runs on Windows and commit it!

Original comment by georg.br...@gmail.com on 9 Dec 2007 at 10:26

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Committed r63446.

Original comment by georg.br...@gmail.com on 18 May 2008 at 9:12