[MERGE] make init-repo use '.' as default location

John Arbash Meinel john at arbash-meinel.com
Sat Jul 12 17:29:28 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Westby wrote:
| 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
|

I would just add that we tend to put the "expected" value on the left.
And for None you generally check with is, so it would normally be:

self.assertIsNot(None, dir.open_repository())

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkh42+gACgkQJdeBCYSNAAMt1gCfVy0tse4iWlP30OcxGxRjonOy
tYMAn34rmsoJ4Xzaf3G+WQUEp//RTjl5
=sx3O
-----END PGP SIGNATURE-----



More information about the bazaar mailing list