1
# Copyright (C) 2006-2010 Canonical Ltd
1
# Copyright (C) 2006 Canonical Ltd
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
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
17
17
"""Test branches with inaccessible parents."""
23
from bzrlib.tests import (
29
class InaccessibleParentTests(per_branch.TestCaseWithBranch):
21
from bzrlib import branch, errors
22
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
23
from bzrlib.tests.http_server import HttpServer
24
from bzrlib.transport.local import LocalURLServer
25
from bzrlib.transport.chroot import TestingChrootServer
28
class InaccessibleParentTests(TestCaseWithBranch):
30
29
"""Tests with branches with "inaccessible" parents.
32
31
An "inaccessible" parent location is one that cannot be represented, e.g. if
33
32
a child branch says its parent is at "../../my-parent", but that child is at
34
33
"http://host/one" then that parent location is inaccessible. These
39
38
super(InaccessibleParentTests, self).setUp()
40
if self.transport_server in (test_server.LocalURLServer, None):
41
self.transport_readonly_server = test_server.TestingChrootServer
39
if self.transport_server in (LocalURLServer, None):
40
self.transport_readonly_server = TestingChrootServer
43
42
def get_branch_with_invalid_parent(self):
44
43
"""Get a branch whose get_parent will raise InaccessibleParent."""