[MERGE] Improvements to test_bzrdir
Martin Pool
mbp at canonical.com
Fri Aug 18 08:16:01 BST 2006
On 18 Aug 2006, Robert Collins <robertc at robertcollins.net> wrote:
> On Fri, 2006-08-18 at 15:26 +1000, Andrew Bennetts wrote:
> > - target = dir.sprout(self.get_url('target'))
> > + try:
> > + target = dir.sprout(self.get_url('target'))
> > + except errors.NotLocalUrl:
> > + raise TestSkipped('Cannot sprout to remote bzrdirs.')
> > self.assertNotEqual(dir.transport.base,
> > target.transport.base)
> > self.assertDirectoriesEqual(dir.root_transport,
> > target.root_transport,
> > ['./.bzr/stat-cache',
> > @@ -602,7 +665,10 @@
> > shared_repo = self.make_repository('target', shared=True)
> > except errors.IncompatibleFormat:
> > return
> > - target = dir.sprout(self.get_url('target/child'))
> > + try:
> > + target = dir.sprout(self.get_url('target/child'))
> > + except errors.NotLocalUrl:
> > + raise TestSkipped('Cannot sprout to remote bzrdirs.')
>
>
> This is still somewhat redundant...
>
> would be nice to have this block factored out too (it appears a number
> of times).
I know what you mean but you do get to a point where it's in fact easier
to call two methods than to have one complex one. Would raising
TestSkipped with the exception perhaps give a reasonable text
automatically?
--
Martin
More information about the bazaar
mailing list