~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_annotate.py

Merge from integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from bzrlib.clone import copy_branch
35
35
from bzrlib.errors import BzrCommandError
36
36
from bzrlib.osutils import has_symlinks
37
 
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
 
37
from bzrlib.tests import TestCaseInTempDir, BzrTestBase
38
38
from bzrlib.annotate import annotate_file
39
39
 
40
40
 
42
42
    def setUp(self):
43
43
        super(TestAnnotate, self).setUp()
44
44
        b = Branch.initialize('.')
45
 
        self.build_tree_contents([('hello.txt', 'my helicopter\n')])
46
 
        b.add(['hello.txt'])
47
 
        b.commit('add hello', 
48
 
                 committer='test@user')
 
45
        self.build_tree_contents([('hello.txt', 'my helicopter\n'),
 
46
                                  ('nomail.txt', 'nomail\n')])
 
47
        b.working_tree().add(['hello.txt'])
 
48
        b.working_tree().commit('add hello', 
 
49
                                committer='test@user')
 
50
        b.working_tree().add(['nomail.txt'])
 
51
        b.working_tree().commit('add nomail', committer='no mail')
49
52
 
50
53
    def test_help_annotate(self):
51
54
        """Annotate command exists"""
57
60
        self.assertEqualDiff(out, '''\
58
61
    1 test@us | my helicopter
59
62
''')
 
63
 
 
64
    def test_no_mail(self):
 
65
        out, err = self.run_bzr_captured(['annotate', 'nomail.txt'])
 
66
        self.assertEquals(err, '')
 
67
        self.assertEqualDiff(out, '''\
 
68
    2 no mail | nomail
 
69
''')