[MERGE] make init-repo use '.' as default location
James Westby
jw+debian at jameswestby.net
Sat Jul 12 11:57:19 BST 2008
On Sat, 2008-07-12 at 04:45 -0600, Scott Scriven wrote:
> Thanks. I looked in test_init.py, and missed
> test_shared_repository.py. Also, I'm not familiar with bzr's
> python API, so this gave me a good excuse to learn a some of it.
>
> The new bundle includes a working test.
Thanks for working on this.
> + def test_init_repo_no_given_dir(self):
> + """'bzr init-repo' with no parameters creates a repo
> +
> + (bug lp:247150)
> + """
> + out, err = self.run_bzr('init-repository')
> + dir = BzrDir.open('.')
> + self.assertTrue(dir.open_repository())
> +
I'm not sure whether assertTrue is the correct thing to use
here. The main test is that this doesn't throw an exception,
which is what would indicate there was no repository. However,
I presume that exception would come when opening the BzrDir.
Anyway, I think testing for True/False isn't quite right,
and I'd prefer
self.assertNotEqual(dir.open_repository(), None)
Apart from that, my only concern is that which I raised in
my other message, so we'll see if anyone else considers
that something which means we should have this.
Thanks,
James
More information about the bazaar
mailing list