62
65
self.assertNotEqual(None, mismatch)
63
66
self.assertThat(mismatch.describe(), Equals("I am da tree is locked"))
69
class TestMatchesAncestry(TestCaseWithTransport):
71
def test__str__(self):
72
matcher = MatchesAncestry("A repository", "arevid")
74
"MatchesAncestry(repository='A repository', "
75
"revision_id='arevid')",
79
b = self.make_branch_builder('.')
81
revid1 = b.build_commit()
82
revid2 = b.build_commit()
84
branch = b.get_branch()
85
m = MatchesAncestry(branch.repository, revid2)
86
self.assertThat([revid2, revid1], m)
87
self.assertThat([revid1, revid2], m)
88
m = MatchesAncestry(branch.repository, revid1)
89
self.assertThat([revid1], m)
90
m = MatchesAncestry(branch.repository, "unknown")
91
self.assertRaises(AssertionError, m.match, [])
93
def test_mismatch(self):
94
b = self.make_branch_builder('.')
96
revid1 = b.build_commit()
97
revid2 = b.build_commit()
99
branch = b.get_branch()
100
m = MatchesAncestry(branch.repository, revid1)
101
mismatch = m.match([])
102
self.assertIsNot(None, mismatch)
104
"mismatched ancestry for revision '%s' was ['%s'], expected []" % (