~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_shared_repository.py

  • Committer: Robert Collins
  • Date: 2010-05-11 08:44:59 UTC
  • mfrom: (5221 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100511084459-pb0uinna9zs3wu59
Merge trunk - resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
 
21
from bzrlib import osutils
21
22
from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat1
22
23
import bzrlib.errors as errors
23
24
from bzrlib.tests import TestCaseInTempDir
145
146
        self.assertLength(0, calls)
146
147
        self.run_bzr("init-repository a")
147
148
        self.assertLength(1, calls)
 
149
 
 
150
    def test_init_repo_without_username(self):
 
151
        """Ensure init-repo works if username is not set.
 
152
        """
 
153
        # bzr makes user specified whoami mandatory for operations
 
154
        # like commit as whoami is recorded. init-repo however is not so final
 
155
        # and uses whoami only in a lock file. Without whoami the login name
 
156
        # is used. This test is to ensure that init-repo passes even when whoami
 
157
        # is not available.
 
158
        osutils.set_or_unset_env('EMAIL', None)
 
159
        osutils.set_or_unset_env('BZR_EMAIL', None)
 
160
        out, err = self.run_bzr(['init-repo', 'foo'])
 
161
        self.assertEqual(err, '')
 
162
        self.assertTrue(os.path.exists('foo'))