~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_logformats.py

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 08:15:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5498.
  • Revision ID: andrew.bennetts@canonical.com-20101008081514-dviqzrdfwyzsqbz2
Split NEWS into per-release doc/en/release-notes/bzr-*.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009, 2011, 2016 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
60
60
        self._make_simple_branch()
61
61
        # only the lines formatter is this short, one line by revision
62
62
        log = self.run_bzr('log')[0]
63
 
        self.assertEqual(2, len(log.splitlines()))
 
63
        self.assertEquals(2, len(log.splitlines()))
64
64
 
65
65
    def test_log_format_arg(self):
66
66
        self._make_simple_branch()
77
77
        # one line for 'You are missing 2 revision(s)'
78
78
        # one line by missing revision (the line log format is used as
79
79
        # configured)
80
 
        self.assertEqual(4, len(missing.splitlines()))
 
80
        self.assertEquals(4, len(missing.splitlines()))
81
81
 
82
82
    def test_missing_format_arg(self):
83
83
        wt = self._make_simple_branch('a')
90
90
        # one line for 'Using save location'
91
91
        # one line for 'You are missing 2 revision(s)'
92
92
        # three lines by missing revision
93
 
        self.assertEqual(8, len(missing.splitlines()))
 
93
        self.assertEquals(8, len(missing.splitlines()))
94
94
 
95
95
    def test_logformat_gnu_changelog(self):
96
96
        # from http://launchpad.net/bugs/29582/
100
100
 
101
101
        log, err = self.run_bzr(['log', '--log-format', 'gnu-changelog',
102
102
                                 '--timezone=utc'])
103
 
        self.assertEqual('', err)
 
103
        self.assertEquals('', err)
104
104
        expected = """2009-03-03  Joe Foo  <joe@foo.com>
105
105
 
106
106
\tfirst revision
107
107
 
108
108
"""
109
109
        self.assertEqualDiff(expected, log)
110
 
 
111
 
    def test_logformat_line_wide(self):
112
 
        """Author field should get larger for column widths over 80"""
113
 
        wt = self.make_branch_and_tree('.')
114
 
        wt.commit('revision with a long author', committer='Person with' 
115
 
                  ' long name SENTINEL')
116
 
        log, err = self.run_bzr('log --line')
117
 
        self.assertNotContainsString(log, 'SENTINEL')
118
 
        self.overrideEnv('BZR_COLUMNS', '116')
119
 
        log, err = self.run_bzr('log --line')
120
 
        self.assertContainsString(log, 'SENT...')
121
 
        self.overrideEnv('BZR_COLUMNS', '0')
122
 
        log, err = self.run_bzr('log --line')
123
 
        self.assertContainsString(log, 'SENTINEL')
124