1442
1442
descendants = graph.find_descendants('rev2a', 'rev4')
1443
1443
self.assertEqual(set(['rev2a', 'rev3', 'rev4']), descendants)
1445
class TestFindLefthandMerger(TestGraphBase):
1447
def check_merger(self, result, ancestry, merged, tip):
1448
graph = self.make_graph(ancestry)
1449
self.assertEqual(result, graph.find_lefthand_merger(merged, tip))
1451
def test_find_lefthand_merger_rev2b(self):
1452
self.check_merger('rev4', ancestry_1, 'rev2b', 'rev4')
1454
def test_find_lefthand_merger_rev2a(self):
1455
self.check_merger('rev2a', ancestry_1, 'rev2a', 'rev4')
1457
def test_find_lefthand_merger_rev4(self):
1458
self.check_merger(None, ancestry_1, 'rev4', 'rev2a')
1460
def test_find_lefthand_merger_f(self):
1461
self.check_merger('i', complex_shortcut, 'f', 'm')
1463
def test_find_lefthand_merger_g(self):
1464
self.check_merger('i', complex_shortcut, 'g', 'm')
1466
def test_find_lefthand_merger_h(self):
1467
self.check_merger('n', complex_shortcut, 'h', 'n')
1446
1470
class TestGetChildMap(TestGraphBase):