/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_whoami.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Black-box tests for bzr whoami."""
 
18
"""Black-box tests for brz whoami."""
19
19
 
20
 
import bzrlib
21
 
from bzrlib import (
 
20
import breezy
 
21
from breezy import (
22
22
    branch,
23
23
    config,
24
24
    errors,
57
57
    def test_whoami_branch(self):
58
58
        """branch specific user identity works."""
59
59
        wt = self.make_branch_and_tree('.')
60
 
        b = bzrlib.branch.Branch.open('.')
 
60
        b = breezy.branch.Branch.open('.')
61
61
        self.set_branch_email(b, 'Branch Identity <branch@identi.ty>')
62
62
        self.assertWhoAmI('Branch Identity <branch@identi.ty>')
63
63
        self.assertWhoAmI('branch@identi.ty', '--email')
64
64
 
65
65
        # Verify that the environment variable overrides the value
66
66
        # in the file
67
 
        self.overrideEnv('BZR_EMAIL', 'Different ID <other@environ.ment>')
 
67
        self.overrideEnv('BRZ_EMAIL', 'Different ID <other@environ.ment>')
68
68
        self.assertWhoAmI('Different ID <other@environ.ment>')
69
69
        self.assertWhoAmI('other@environ.ment', '--email')
70
70
 
82
82
        encoding.
83
83
        """
84
84
        wt = self.make_branch_and_tree('.')
85
 
        b = bzrlib.branch.Branch.open('.')
 
85
        b = breezy.branch.Branch.open('.')
86
86
        self.set_branch_email(b, u'Branch Identity \u20ac <branch@identi.ty>')
87
87
        self.assertWhoAmI('Branch Identity ? <branch@identi.ty>',
88
88
                          encoding='ascii')
101
101
        """Ensure whoami error if username is not set and not inferred.
102
102
        """
103
103
        self.overrideEnv('EMAIL', None)
104
 
        self.overrideEnv('BZR_EMAIL', None)
 
104
        self.overrideEnv('BRZ_EMAIL', None)
105
105
        # Also, make sure that it's not inferred from mailname.
106
106
        self.overrideAttr(config, '_auto_user_id', lambda: (None, None))
107
107
        out, err = self.run_bzr(['whoami'], 3)
138
138
                          c.get('email'))
139
139
        # Ensuring that the value does not come from the bazaar.conf file
140
140
        # itself requires some isolation setup
141
 
        self.overrideEnv('BZR_EMAIL', None)
 
141
        self.overrideEnv('BRZ_EMAIL', None)
142
142
        self.overrideEnv('EMAIL', None)
143
143
        self.overrideAttr(config, '_auto_user_id', lambda: (None, None))
144
144
        global_conf = config.GlobalStack()