31
31
def test_describe_standalone_layout(self):
32
32
tree = self.make_branch_and_tree('tree')
33
33
self.assertEqual('Empty control directory', info.describe_layout())
35
'Unshared repository with trees and colocated branches',
36
info.describe_layout(tree.branch.repository, control=tree.bzrdir))
34
self.assertEqual('Unshared repository with trees',
35
info.describe_layout(tree.branch.repository))
37
36
tree.branch.repository.set_make_working_trees(False)
38
self.assertEqual('Unshared repository with colocated branches',
39
info.describe_layout(tree.branch.repository, control=tree.bzrdir))
37
self.assertEqual('Unshared repository',
38
info.describe_layout(tree.branch.repository))
40
39
self.assertEqual('Standalone branch',
41
info.describe_layout(tree.branch.repository, tree.branch,
40
info.describe_layout(tree.branch.repository, tree.branch))
43
41
self.assertEqual('Standalone branchless tree',
44
info.describe_layout(tree.branch.repository, None, tree,
42
info.describe_layout(tree.branch.repository, None, tree))
46
43
self.assertEqual('Standalone tree',
47
info.describe_layout(tree.branch.repository, tree.branch, tree,
44
info.describe_layout(tree.branch.repository, tree.branch, tree))
49
45
tree.branch.bind(tree.branch)
50
46
self.assertEqual('Bound branch',
51
info.describe_layout(tree.branch.repository, tree.branch,
47
info.describe_layout(tree.branch.repository, tree.branch))
53
48
self.assertEqual('Checkout',
54
info.describe_layout(tree.branch.repository, tree.branch, tree,
49
info.describe_layout(tree.branch.repository, tree.branch, tree))
56
50
checkout = tree.branch.create_checkout('checkout', lightweight=True)
57
51
self.assertEqual('Lightweight checkout',
58
52
info.describe_layout(checkout.branch.repository, checkout.branch,
59
checkout, control=tree.bzrdir))
61
55
def test_describe_repository_layout(self):
62
56
repository = self.make_repository('.', shared=True)
63
57
tree = controldir.ControlDir.create_branch_convenience('tree',
64
58
force_new_tree=True).bzrdir.open_workingtree()
65
self.assertEqual('Shared repository with trees and colocated branches',
66
info.describe_layout(tree.branch.repository, control=tree.bzrdir))
59
self.assertEqual('Shared repository with trees',
60
info.describe_layout(tree.branch.repository))
67
61
repository.set_make_working_trees(False)
68
self.assertEqual('Shared repository with colocated branches',
69
info.describe_layout(tree.branch.repository, control=tree.bzrdir))
62
self.assertEqual('Shared repository',
63
info.describe_layout(tree.branch.repository))
70
64
self.assertEqual('Repository branch',
71
info.describe_layout(tree.branch.repository, tree.branch,
65
info.describe_layout(tree.branch.repository, tree.branch))
73
66
self.assertEqual('Repository branchless tree',
74
info.describe_layout(tree.branch.repository, None, tree,
67
info.describe_layout(tree.branch.repository, None, tree))
76
68
self.assertEqual('Repository tree',
77
info.describe_layout(tree.branch.repository, tree.branch, tree,
69
info.describe_layout(tree.branch.repository, tree.branch, tree))
79
70
tree.branch.bind(tree.branch)
80
71
self.assertEqual('Repository checkout',
81
info.describe_layout(tree.branch.repository, tree.branch, tree,
72
info.describe_layout(tree.branch.repository, tree.branch, tree))
83
73
checkout = tree.branch.create_checkout('checkout', lightweight=True)
84
74
self.assertEqual('Lightweight checkout',
85
75
info.describe_layout(checkout.branch.repository, checkout.branch,
86
checkout, control=tree.bzrdir))
88
78
def assertTreeDescription(self, format):
89
79
"""Assert a tree's format description matches expectations"""