[RFC] Multipart support for _urllib_

Michael Ellerman michael at ellerman.id.au
Wed Jun 21 15:25:42 BST 2006


On 6/21/06, John Arbash Meinel <john at arbash-meinel.com> wrote:
> We work pretty hard to mirror the source tree. Not that it is perfect,
> but generally if there is a 'bzrlib/foo.py' there is a test suite
> 'bzrlib/tests/test_foo.py'
...
> The only other 'trick' comes into play with our adapted tests. For
> things which have multiple implementations of an interface (Transport,
> Branch, Repository, WorkingTree), we try to have a directory with
> specific tests. Then the test runner grabs those tests and adapts them
> to run against each implementation.
> (So you only write 'test_get_revision', and it gets adapted to run
> against every repository implementation).

Yeah, that's what threw me, the transport tests require a bit of
reading before it's obvious what's going on. But I think I grok it
now.

> I'm not sure what documentation you are looking for, which is probably
> why it isn't written yet. What would be the most helpful for you?
>
> We have some crufts in our tests, since they really just grew, and not
> all of them were cleaned up as we added cleaner apis to help testing.

It'd just be good to have some doco on when to use
run_bzr()/run_bzr_captured()/capture() etc. and all the other helpers,
assertReMatches() or whatever, and the make_branch_and_tree() or
whatever helpers. But I don't want to whinge, it's all deducible, just
a minor barrier.

> For testing the new code, I could see a few things.
> Move the _offsets_to_ranges to either be a separated function (say in
> osutils), or a @staticmethod of the root level transport. (I don't
> believe it requires any state).
> And then write a test for it in either tests/test_transport.py or
> tests/test_osutils.py Which just tests the different overlapping rules.

I was thinking of making it static on HttpTransportBase, because I
don't see it really having any use outside of Http, after all they're
HTTP byte ranges that we're talking about. I've also found
test_http.py which I think I'll hack on.

cheers




More information about the bazaar mailing list