33
33
from bzrlib.branch import Branch
34
from bzrlib.clone import copy_branch
35
34
from bzrlib.errors import BzrCommandError
36
35
from bzrlib.osutils import has_symlinks
37
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
36
from bzrlib.tests import TestCaseWithTransport
38
37
from bzrlib.annotate import annotate_file
41
class TestAnnotate(TestCaseInTempDir):
40
class TestAnnotate(TestCaseWithTransport):
43
super(TestAnnotate, self).setUp()
44
wt = self.make_branch_and_tree('.')
46
self.build_tree_contents([('hello.txt', 'my helicopter\n'),
47
('nomail.txt', 'nomail\n')])
49
wt.commit('add hello',
50
committer='test@user')
51
wt.add(['nomail.txt'])
52
wt.commit('add nomail', committer='no mail')
42
54
def test_help_annotate(self):
43
55
"""Annotate command exists"""
44
56
out, err = self.run_bzr_captured(['--no-plugins', 'annotate', '--help'])
58
def test_annotate_cmd(self):
59
out, err = self.run_bzr_captured(['annotate', 'hello.txt'])
60
self.assertEquals(err, '')
61
self.assertEqualDiff(out, '''\
62
1 test@us | my helicopter
65
def test_no_mail(self):
66
out, err = self.run_bzr_captured(['annotate', 'nomail.txt'])
67
self.assertEquals(err, '')
68
self.assertEqualDiff(out, '''\