~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testlog.py

  • Committer: Martin Pool
  • Date: 2005-08-29 10:57:01 UTC
  • mfrom: (1092.1.41)
  • Revision ID: mbp@sourcefrog.net-20050829105701-7aaa81ecf1bfee05
- merge in merge improvements and additional tests 
  from aaron and lifeless

robertc@robertcollins.net-20050825131100-85772edabc817481

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
 
18
from cStringIO import StringIO
18
19
 
19
 
from bzrlib.selftest import BzrTestBase
 
20
from bzrlib.selftest import BzrTestBase, InTempDir
20
21
from bzrlib.log import LogFormatter, show_log, LongLogFormatter
21
22
from bzrlib.branch import Branch
22
23
 
47
48
        self.logs.append(le)
48
49
 
49
50
 
50
 
class SimpleLogTest(BzrTestBase):
 
51
class SimpleLogTest(InTempDir):
51
52
 
52
53
    def checkDelta(self, delta, **kw):
53
54
        """Check the filenames touched by a delta are as expected."""
88
89
        self.build_tree(['hello'])
89
90
        b.add('hello')
90
91
        b.commit('add one file')
 
92
 
 
93
        lf = StringIO()
91
94
        # log using regular thing
92
 
        show_log(b, LongLogFormatter(self.TEST_LOG))
 
95
        show_log(b, LongLogFormatter(lf))
 
96
        lf.seek(0)
 
97
        for l in lf.readlines():
 
98
            self.log(l)
93
99
 
94
100
        # get log as data structure
95
101
        lf = LogCatcher()