remove LocalAbspathServer, LocalRelpathServer
John Arbash Meinel
john at arbash-meinel.com
Fri Aug 25 05:53:44 BST 2006
Martin Pool wrote:
> On 24 Aug 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
>> Martin Pool wrote:
>> I don't see any tests doing "directly test constructing transports from
>> paths". I just see the removal of the other transport servers.
>>
>> +1 on removing them from me. But I'd like to see the other things tested
>> first.
>
> Sorry, I just sent the wrong bundle - just removing them as that one did
> would break things. Here is the correct fix.
>
> Getting that wrong makes me think that the current interpretation of -r
> for bundle could be better. Perhaps 'bzr bundle -r -2' should give the
> bundle from -2, similar to bzr diff?
Possibly. But I think it is better to use the:
bzr bundle ../bzr.dev
Form, because that one will give you a bundle that can be definitely
applied.
Also, if you did 'bzr branch bzr.dev my-code'
The parent is set correctly, so that a plain 'bzr bundle' gives the
right answer.
I use that form them most (though I use bzr cbranch)
...
> )
> from bzrlib.transport.memory import MemoryTransport
> from bzrlib.transport.local import LocalTransport
> +from bzrlib import urlutils
> +
> +
> +# TODO: Should possibly split transport-specific tests into their own files.
Shouldn't this import be up higher? Possibly grouped with other 'from
bzrlib import foo' imports?
>
>
> class TestTransport(TestCase):
> @@ -319,8 +323,8 @@
> server = fakenfs.FakeNFSServer()
> server.setUp()
> try:
> - # the server should be a relpath localhost server
> - self.assertEqual(server.get_url(), 'fakenfs+.')
> + # the url should be decorated appropriately
> + self.assertTrue(server.get_url().startswith('fakenfs+'))
^- we already have a 'self.assertStartsWith()' which is better because
it gives more understandable error messages.
...
> +
> +
> +class TestLocalTransports(TestCase):
> +
> + def test_get_transport_from_abspath(self):
> + here = os.path.abspath('.')
> + t = get_transport(here)
> + self.assertIsInstance(t, LocalTransport)
> + self.assertEquals(t.base, urlutils.local_path_to_url(here) + '/')
> +
> + def test_get_transport_from_relpath(self):
> + here = os.path.abspath('.')
> + t = get_transport('.')
> + self.assertIsInstance(t, LocalTransport)
> + self.assertEquals(t.base, urlutils.local_path_to_url(here) + '/')
^- 'urlutils.local_path_to_url()' can also take a relative path, if it
makes it more symmetric.
Otherwise it looks good.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060824/667a639e/attachment.pgp
More information about the bazaar
mailing list