~ubuntu-branches/ubuntu/oneiric/bzr/oneiric

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_has_same_location.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-28 22:34:03 UTC
  • mfrom: (3815.2547.111 upstream)
  • Revision ID: jelmer@samba.org-20110428223403-iw7pg8u0rsegjwxo
releasing version 2.4.0~beta2-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    bzrdir,
21
21
    transport,
22
22
    )
 
23
from bzrlib.remote import (
 
24
    RemoteRepositoryFormat,
 
25
    )
23
26
from bzrlib.tests import (
24
27
    TestNotApplicable,
25
28
    )
64
67
        """Different repository objects for the same location are the same."""
65
68
        repo = self.make_repository('.')
66
69
        reopened_repo = repo.bzrdir.open_repository()
67
 
        self.failIf(
 
70
        self.assertFalse(
68
71
            repo is reopened_repo,
69
72
            "This test depends on reopened_repo being a different instance of "
70
73
            "the same repo.")
84
87
        CopyConverter creates a second repository in one bzrdir.
85
88
        """
86
89
        repo = self.make_repository('repo')
87
 
        try:
88
 
            control_transport = repo._transport
89
 
        except AttributeError:
90
 
            raise TestNotApplicable(
91
 
                "%r has no transport" % (repo,))
92
 
        if control_transport.base == repo.bzrdir.transport.base:
 
90
        if repo.control_transport.base == repo.bzrdir.control_transport.base:
93
91
            raise TestNotApplicable(
94
92
                "%r has repository files directly in the bzrdir"
95
93
                % (repo,))
96
94
            # This test only applies to repository formats where the repo
97
95
            # control_files are separate from other bzrdir files, i.e. metadir
98
96
            # formats.
99
 
        control_transport.copy_tree('.', '../repository.backup')
100
 
        backup_transport = control_transport.clone('../repository.backup')
101
 
        backup_repo = repo._format.open(repo.bzrdir, _found=True,
 
97
        repo.control_transport.copy_tree('.', '../repository.backup')
 
98
        backup_transport = repo.control_transport.clone('../repository.backup')
 
99
        if isinstance(repo._format, RemoteRepositoryFormat):
 
100
            raise TestNotApplicable("remote repositories don't support overriding "
 
101
                                    "transport")
 
102
        backup_repo = repo._format.open(repo.bzrdir,
102
103
                                        _override_transport=backup_transport)
103
104
        self.assertDifferentRepo(repo, backup_repo)
104
105