1424
1424
self.assertMergeOrder(['rev3', 'rev1'], graph, 'rev4', ['rev1', 'rev3'])
1427
class TestFindDescendants(TestGraphBase):
1429
def test_find_descendants_rev1_rev3(self):
1430
graph = self.make_graph(ancestry_1)
1431
descendants = graph.find_descendants('rev1', 'rev3')
1432
self.assertEqual(set(['rev1', 'rev2a', 'rev3']), descendants)
1434
def test_find_descendants_rev1_rev4(self):
1435
graph = self.make_graph(ancestry_1)
1436
descendants = graph.find_descendants('rev1', 'rev4')
1437
self.assertEqual(set(['rev1', 'rev2a', 'rev2b', 'rev3', 'rev4']),
1440
def test_find_descendants_rev2a_rev4(self):
1441
graph = self.make_graph(ancestry_1)
1442
descendants = graph.find_descendants('rev2a', 'rev4')
1443
self.assertEqual(set(['rev2a', 'rev3', 'rev4']), descendants)
1446
class TestGetChildMap(TestGraphBase):
1448
def test_get_child_map(self):
1449
graph = self.make_graph(ancestry_1)
1450
child_map = graph.get_child_map(['rev4', 'rev3', 'rev2a', 'rev2b'])
1451
self.assertEqual({'rev1': ['rev2a', 'rev2b'],
1427
1458
class TestCachingParentsProvider(tests.TestCase):
1428
1459
"""These tests run with: