~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2007-03-22 05:27:08 UTC
  • mto: (2323.5.2 0.15)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: mbp@sourcefrog.net-20070322052708-t4g4iv46n2dcjjaa
(broken) Give a message when opening old workingtree formats suggesting upgrade

This breaks some blackbox tests of old formats that don't expect to see this
message.

Add WorkingTree._after_opening callback

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Blackbox tests for the 'bzr testament' command"""
18
18
 
19
 
import re
20
19
 
21
20
from bzrlib.tests.test_testament import (
22
 
    osutils,
23
21
    REV_1_SHORT,
24
22
    REV_1_SHORT_STRICT,
25
23
    REV_2_TESTAMENT,
32
30
 
33
31
    def test_testament_command(self):
34
32
        """Testament containing a file and a directory."""
35
 
        out, err = self.run_bzr('testament --long')
 
33
        out, err = self.run_bzr('testament', '--long')
36
34
        self.assertEqualDiff(err, '')
37
35
        self.assertEqualDiff(out, REV_2_TESTAMENT)
38
36
 
39
37
    def test_testament_command_2(self):
40
38
        """Command getting short testament of previous version."""
41
 
        out, err = self.run_bzr('testament -r1')
 
39
        out, err = self.run_bzr('testament', '-r1')
42
40
        self.assertEqualDiff(err, '')
43
41
        self.assertEqualDiff(out, REV_1_SHORT)
44
42
 
45
43
    def test_testament_command_3(self):
46
44
        """Command getting short testament of previous version."""
47
 
        out, err = self.run_bzr('testament -r1 --strict')
 
45
        out, err = self.run_bzr('testament', '-r1', '--strict')
48
46
        self.assertEqualDiff(err, '')
49
47
        self.assertEqualDiff(out, REV_1_SHORT_STRICT)
50
48
 
51
 
    def test_testament_non_ascii(self):
52
 
        self.wt.commit(u"Non \xe5ssci message")
53
 
        long_out, err = self.run_bzr('testament --long')
54
 
        self.assertEqualDiff(err, '')
55
 
        short_out, err = self.run_bzr('testament')
56
 
        self.assertEqualDiff(err, '')
57
 
        sha1_re = re.compile('sha1: (?P<sha1>[a-f0-9]+)$', re.M)
58
 
        sha1 = sha1_re.search(short_out).group('sha1')
59
 
        self.assertEqual(sha1, osutils.sha_string(long_out))