~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testlog.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-09-04 02:59:56 UTC
  • mfrom: (1172)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050904025956-776ba4f07de97700
Merged mpool's latest changes (~0.0.7)

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, TestCaseInTempDir
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(TestCaseInTempDir):
51
52
 
52
53
    def checkDelta(self, delta, **kw):
53
54
        """Check the filenames touched by a delta are as expected."""
64
65
 
65
66
    def test_simple_log(self):
66
67
        eq = self.assertEquals
67
 
        ass = self.assert_
68
68
        
69
69
        b = Branch('.', init=True)
70
70
 
88
88
        self.build_tree(['hello'])
89
89
        b.add('hello')
90
90
        b.commit('add one file')
 
91
 
 
92
        lf = StringIO()
91
93
        # log using regular thing
92
 
        show_log(b, LongLogFormatter(self.TEST_LOG))
 
94
        show_log(b, LongLogFormatter(lf))
 
95
        lf.seek(0)
 
96
        for l in lf.readlines():
 
97
            self.log(l)
93
98
 
94
99
        # get log as data structure
95
100
        lf = LogCatcher()