~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2010-03-15 06:54:44 UTC
  • mto: This revision was merged to the branch mainline in revision 5095.
  • Revision ID: mbp@canonical.com-20100315065444-gfs7vp8te4ez5rc9
Fix typo in ReadVFile.readline (thanks mnordhoff)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 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
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Black box tests for the upgrade ui."""
18
 
import os
19
 
import stat
20
18
 
21
19
from bzrlib import (
22
20
    bzrdir,
23
21
    repository,
24
22
    )
25
23
from bzrlib.tests import (
26
 
    features,
27
24
    TestCaseInTempDir,
28
25
    TestCaseWithTransport,
29
26
    )
149
146
        self.run_bzr('init-repository --format=metaweave repo')
150
147
        self.run_bzr('upgrade --format=knit repo')
151
148
 
152
 
    def test_upgrade_permission_check(self):
153
 
        """'backup.bzr' should retain permissions of .bzr. Bug #262450"""
154
 
        self.requireFeature(features.posix_permissions_feature)
155
 
        old_perms = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
156
 
        backup_dir = 'backup.bzr.~1~'
157
 
        self.run_bzr('init --format=1.6')
158
 
        os.chmod('.bzr', old_perms)
159
 
        self.run_bzr('upgrade')
160
 
        new_perms = os.stat(backup_dir).st_mode & 0777
161
 
        self.assertTrue(new_perms == old_perms)
162
 
 
163
149
 
164
150
    def test_upgrade_with_existing_backup_dir(self):
165
151
        self.make_format_5_branch()