43
44
r" 0 unreferenced text versions\n"
44
45
r"Checking branch at '.*'\.\n"
45
46
r"checked branch.*\n$")
48
def test_check_branch(self):
49
tree = self.make_branch_and_tree('.')
51
out, err = self.run_bzr('check --branch')
52
self.assertContainsRe(err, r"^Checking branch at '.*'\.\n"
53
r"checked branch.*\n$")
55
def test_check_repository(self):
56
tree = self.make_branch_and_tree('.')
58
out, err = self.run_bzr('check --repo')
59
self.assertContainsRe(err, r"^Checking repository at '.*'\.\n"
60
r"checked repository.*\n"
63
r" 0 unique file texts\n"
64
r" 0 repeated file texts\n"
65
r" 0 unreferenced text versions$")
67
def test_check_tree(self):
68
tree = self.make_branch_and_tree('.')
70
out, err = self.run_bzr('check --tree')
71
self.assertContainsRe(err, r"^Checking working tree at '.*'\.\n$")
73
def test_partial_check(self):
74
tree = self.make_branch_and_tree('.')
76
out, err = self.run_bzr('check --tree --branch')
77
self.assertContainsRe(err, r"^Checking working tree at '.*'\.\n"
78
r"Checking branch at '.*'\.\n"
79
r"checked branch.*\n$")
81
def test_check_missing_tree(self):
82
branch = self.make_branch('.')
83
out, err = self.run_bzr('check --tree')
84
self.assertEqual(err, "No working tree found at specified location.\n")
86
def test_check_missing_partial(self):
87
branch = self.make_branch('.')
88
out, err = self.run_bzr('check --tree --branch')
89
self.assertContainsRe(err,
90
r"^No working tree found at specified location\.\n"
91
r"Checking branch at '.*'\.\n"
92
r"checked branch.*\n$")
94
def test_check_missing_branch_in_shared_repo(self):
95
self.make_repository('shared', shared=True)
96
out, err = self.run_bzr('check --branch shared')
97
self.assertEqual(err, "No branch found at specified location.\n")
100
class ChrootedCheckTests(ChrootedTestCase):
102
def test_check_missing_branch(self):
103
out, err = self.run_bzr(
104
'check --branch %s' % self.get_readonly_url(''))
105
self.assertEqual(err, "No branch found at specified location.\n")
107
def test_check_missing_repository(self):
108
out, err = self.run_bzr('check --repo %s' % self.get_readonly_url(''))
109
self.assertEqual(err, "No repository found at specified location.\n")
111
def test_check_missing_everything(self):
112
out, err = self.run_bzr('check %s' % self.get_readonly_url(''))
113
self.assertEqual(err, "No working tree found at specified location.\n"
114
"No branch found at specified location.\n"
115
"No repository found at specified location.\n")