test_connection_error
John A Meinel
john at arbash-meinel.com
Thu Nov 17 22:31:00 GMT 2005
Martin Pool wrote:
> after merging from aaron, I have
>
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/mbp/work/bzr.dev/bzrlib/selftest/testtransport.py", line
> 459, in test_connection_error
> self.assertRaises(ConnectionError, t.get, '.bzr/branch')
> File "/usr/lib/python2.4/unittest.py", line 320, in failUnlessRaises
> callableObj(*args, **kwargs)
> File "/home/mbp/work/bzr.dev/bzrlib/transport/http.py", line 149, in
> get
> orig_error=e)
> NoSuchFile: no such file: Error retrieving http://www.example.com/.bzr/branch: HTTP Error 404: Not Found
>
> This is just because of an exception class mismatch, NoSuchFile vs
> ConnectionError. For the moment I'll just generalize the exception; if
> someone has a strong opinion say so.
>
I have a custom domain setup in my name. And at home, I default to
searching that path. Which means I can type https://mail rather than
https://mail.arbash-meinel.com/
I recently added a wildcard mapping, so that
http://<anything>.arbash-meinel.com/ resolves. (It makes setting up
virtual hosts easier, since I don't have to go setup a new dns entry).
It has an interesting side effect, that your "bogus_test" won't catch.
Which is that if I'm at home and I type:
http://quiqu]aoeuaaoeusthaoeu/
It actually resolves to
quiqu]aoeuaaoeusthaoeu.arbash-meinel.com
Which ends up being valid.
So at least on my system, you'll always get "NoSuchFile" rather than
getting a ConnectionError.
I may be fairly unique in my setup, but I would prefer it if a test
didn't always fail on my system.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051117/1d9cccef/attachment.pgp
More information about the bazaar
mailing list