[RFC][PATCH] transport providers
John A Meinel
john at arbash-meinel.com
Tue Jan 10 01:41:38 GMT 2006
Robert Collins wrote:
> On Thu, 2006-01-05 at 10:45 -0600, John Arbash Meinel wrote:
>> Robert Collins wrote:
>
>>>> There were a couple of new exceptions that weren't in errors.py, though
>>>> it didn't seem bad.
>>>
>>> hmm, I dont recall defining *any* new exceptions in this branch - they
>>> already existed elsewhere, just got moved to the relevant transports.
>>> Fair comment that we should address them though.
>>>
>>>
>> The specific exceptions are WebserverNotAvailable, and BadWebserverPath.
>>
>> BadWebserverPath should also not be inheriting from ValueError. But as
>> you say, this might have just been in tests/test_http.py, so we didn't
>> see it before.
>
> They were. I dont think this should block merging as its no worse than
> it was ;0.
Well, I didn't have a problem with them when they were test-only
exceptions. But certainly it is just a question of code review and
cleanliness, not something to forbid merging.
>
>
>> As long as we switch the adapter so that it is possible for plugins to
>> add their own tests, I'm happy enough with the system.
>
> There are two uses needed - adding an implementation to be tested by the
> stock tests, and adding tests to be tested against all implementations.
>
> For the former, this branch needs some work - I've added 'push
> permutations list down into transport modules and allow it to be
> extended' into the BRANCH.TODO.
I saw the commit show up.
>
> For the latter, this is recipe used to run a single test against all
> implementations:
>
> from bzrlib.transport import TransportTestProviderAdapter
> adapter = TransportTestProviderAdapter()
> test_suite = adapter.adapt(my_test)
>
> the test suite uses this in a loop to load all the tests in a module for
> each implementation:
>
> from bzrlib.transport import TransportTestProviderAdapter
> adapter = TransportTestProviderAdapter()
> for mod_name in test_transport_implementations:
> mod = _load_module_by_name(mod_name)
> for test in iter_suite_tests(loader.loadTestsFromModule(mod)):
> suite.addTests(adapter.adapt(test))
>
>
> So a plugin can either patch bzrlib.tests.test_transport_implementations
> to add its test module, or it can duplicate some or all of the loop if
> it wants finer grained control.
>
> Rob
>
It seems reasonable enough. I'll give you a +1.
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/20060109/e4017ca2/attachment.pgp
More information about the bazaar
mailing list