'Test https://github.com/andresriancho/w3af/issues/475
Before the fix parsing a URL like:
http://site.com/foo-http://external-test.com/.zip
Returned a buggy result:
foo-http:/external-test.com/.zip
This is because of the "extra" http which lives in the URL and is not
encoded. The "error" here is that the special characters in a filename
part of a URL should be URL-encoded and in this case they are not.
The Internet is an awful place, and we\'ll find this, so we better handle
them properly.
The issue comes from a call to urlparse.urljoin:
>>> import urlparse
>>> urlparse.urljoin(\'http://foo.com/\', \'spam-bar://eggs.com\')
\'spam-bar://eggs.com\'
Which lives inside the normalize_url method in URL:
fixed_url = urlparse.urljoin(base_url, self.get_path_qs())'

def test_url_in_filename(self):

    u = URL('http://w3af.org/foo-http://external-test.com/.zip')
    self.assertEqual(u.netloc, 'w3af.org')
