~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Update to bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007, 2008 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
17
17
"""Tests for implementations of Repository.has_same_location."""
18
18
 
19
19
from bzrlib import bzrdir
 
20
from bzrlib.tests import (
 
21
    TestNotApplicable,
 
22
    )
20
23
from bzrlib.tests.repository_implementations import TestCaseWithRepository
21
24
from bzrlib.transport import get_transport
22
25
 
80
83
        """
81
84
        repo = self.make_repository('repo')
82
85
        try:
83
 
            control_transport = repo.control_files._transport
 
86
            control_transport = repo._transport
84
87
        except AttributeError:
85
 
            # This test only applies to repository formats with control_files.
86
 
            return
 
88
            raise TestNotApplicable(
 
89
                "%r has no transport" % (repo,))
87
90
        if control_transport.base == repo.bzrdir.transport.base:
 
91
            raise TestNotApplicable(
 
92
                "%r has repository files directly in the bzrdir"
 
93
                % (repo,))
88
94
            # This test only applies to repository formats where the repo
89
95
            # control_files are separate from other bzrdir files, i.e. metadir
90
96
            # formats.
91
 
            return
92
97
        control_transport.copy_tree('.', '../repository.backup')
93
98
        backup_transport = control_transport.clone('../repository.backup')
94
99
        backup_repo = repo._format.open(repo.bzrdir, _found=True,
95
100
                                        _override_transport=backup_transport)
96
 
 
97
101
        self.assertDifferentRepo(repo, backup_repo)
98
102
 
99
103
    def test_different_format_not_equal(self):