[Python-Dev] add a bunch of tests to test_urlparse

Guido van Rossum guido@python.org
Mon, 18 Mar 2002 09:40:26 -0500


> Bug 450225 references a bunch of URL parsing tests based on RFC
> 2396.  I've added them to test_urlparse.py.  The problem is, two of
> them fail.  Should I
> 
>     * check in test_urlparse.py & create an output/test_urlparse that
>       reflects those two errors

Definitely not; it's too easy to forget about it.

>     * check in test_urlparse.py & create an output/test_urlparse that
>       reflects how those two problematic URLs ought to be parsed

Only if you plan to check in a fix to urlparse.py ASAP.

>     * comment out those two failing tests, and generate a 0-error
>       output/test_urlparse file

Possibly, if you don't have time to work on a fix right away.

>     * do nothing

Personally, I think the best solution is to post a bug report to SF
quoting the two tests, and leave them out of the test suite unless you
have a fix.

> Those two failing tests are:
> 
>     urljoin('http://a/b/c/d;p?q', '?y')
>     expected 'http://a/b/c/?y',
>          got 'http://a/b/c/d;p?y'
> 
>     urljoin('http://a/b/c/d;p?q', ';x')
>     expected 'http://a/b/c/;x',
>          got 'http://a/b/c/d;x'
> 
> Finally, this uses the old test format.  Since so much of the test script
> gets touched, should I go ahead and convert to unittest?

That's an entirely different question.  If you feel like it, go
ahead.  (Obviously the asserts given on SF are useless.)

--Guido van Rossum (home page: http://www.python.org/~guido/)