~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robey Pointer
  • Date: 2006-06-29 05:13:26 UTC
  • mto: This revision was merged to the branch mainline in revision 1839.
  • Revision ID: robey@lag.net-20060629051326-55354a4283dc69da
move the whoami blackbox tests into their own file and add more tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 
58
58
class TestCommands(ExternalBase):
59
59
 
60
 
    def test_whoami(self):
61
 
        # this should always identify something, if only "john@localhost"
62
 
        self.runbzr("whoami")
63
 
        self.runbzr("whoami --email")
64
 
 
65
 
        self.assertEquals(self.runbzr("whoami --email",
66
 
                                      backtick=True).count('@'), 1)
67
 
        
68
 
    def test_whoami_branch(self):
69
 
        """branch specific user identity works."""
70
 
        self.runbzr('init')
71
 
        b = bzrlib.branch.Branch.open('.')
72
 
        b.control_files.put_utf8('email', 'Branch Identity <branch@identi.ty>')
73
 
        bzr_email = os.environ.get('BZREMAIL')
74
 
        if bzr_email is not None:
75
 
            del os.environ['BZREMAIL']
76
 
        whoami = self.runbzr("whoami",backtick=True)
77
 
        whoami_email = self.runbzr("whoami --email",backtick=True)
78
 
        self.assertTrue(whoami.startswith('Branch Identity <branch@identi.ty>'))
79
 
        self.assertTrue(whoami_email.startswith('branch@identi.ty'))
80
 
        # Verify that the environment variable overrides the value 
81
 
        # in the file
82
 
        os.environ['BZREMAIL'] = 'Different ID <other@environ.ment>'
83
 
        whoami = self.runbzr("whoami",backtick=True)
84
 
        whoami_email = self.runbzr("whoami --email",backtick=True)
85
 
        self.assertTrue(whoami.startswith('Different ID <other@environ.ment>'))
86
 
        self.assertTrue(whoami_email.startswith('other@environ.ment'))
87
 
        if bzr_email is not None:
88
 
            os.environ['BZREMAIL'] = bzr_email
89
 
 
90
60
    def test_nick_command(self):
91
61
        """bzr nick for viewing, setting nicknames"""
92
62
        os.mkdir('me.dev')