~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-22 14:53:12 UTC
  • mfrom: (1707.3.30 ftp-server)
  • Revision ID: pqm@pqm.ubuntu.com-20060522145312-94c3c934d7cbd9ff
(jam) use medusa as an ftp-server provider, fix FtpTransport

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
 
20
20
from bzrlib.tests import BzrTestBase, TestCaseWithTransport
21
 
from bzrlib.log import LogFormatter, show_log, LongLogFormatter, ShortLogFormatter
 
21
from bzrlib.log import (LogFormatter, show_log, LongLogFormatter,
 
22
                        ShortLogFormatter, LineLogFormatter)
22
23
from bzrlib.branch import Branch
23
24
from bzrlib.errors import InvalidRevisionNumber
24
25
 
39
40
    def __init__(self):
40
41
        super(LogCatcher, self).__init__(to_file=None)
41
42
        self.logs = []
42
 
        
43
 
        
 
43
 
44
44
    def show(self, revno, rev, delta):
45
45
        le = _LogEntry()
46
46
        le.revno = revno
276
276
added:
277
277
  a
278
278
''')
 
279
 
 
280
    def test_line_log(self):
 
281
        """Line log should show revno
 
282
        
 
283
        bug #5162
 
284
        """
 
285
        wt = self.make_branch_and_tree('.')
 
286
        b = wt.branch
 
287
        self.build_tree(['a'])
 
288
        wt.add('a')
 
289
        b.nick = 'test-line-log'
 
290
        wt.commit(message='add a', 
 
291
                  timestamp=1132711707, 
 
292
                  timezone=36000,
 
293
                  committer='Line-Log-Formatter Tester <test@line.log>')
 
294
        logfile = file('out.tmp', 'w+')
 
295
        formatter = LineLogFormatter(to_file=logfile)
 
296
        show_log(b, formatter)
 
297
        logfile.flush()
 
298
        logfile.seek(0)
 
299
        log_contents = logfile.read()
 
300
        self.assertEqualDiff(log_contents, '1: Line-Log-Formatte... 2005-11-23 add a\n')