def test_init_pedigree(self): '''Test reading a pedigree from file.''' ped = fp.read_pedigree(TestFamPlot.__PEDIGREE) assert_equal(ped.graph.number_of_nodes(), 22, 'Wrong number of nodes') assert_equal(ped.graph.number_of_edges(), 24, 'Wrong number of edges') assert_equal(ped.person_graph.number_of_nodes(), 15, 'Wrong number of nodes') assert_equal(ped.person_graph.number_of_edges(), 20, 'Wrong number of edges') ped = fp.read_pedigree(TestFamPlot.__PEDIGREE_SINGLE_CHILD) assert_equal(ped.graph.number_of_nodes(), 25, 'Wrong number of nodes') assert_equal(ped.graph.number_of_edges(), 27, 'Wrong number of edges') assert_equal(ped.person_graph.number_of_nodes(), 17, 'Wrong number of nodes') assert_equal(ped.person_graph.number_of_edges(), 22, 'Wrong number of edges')
def test_generation_number(self): '''Test calculating generation numbers..''' ped = fp.read_pedigree(TestFamPlot.__PEDIGREE_UNBALANCED) ped_info = fp.PedigreeInfo(ped) cp = fp.CoordParams() cp.algorithm = 'default' fp.compute_coords(ped_info, cp) assert_equal(ped_info.gen_dict, {1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 2, 7: 2, 8: 3}, 'Wrong generation numbers')
def test_generation_number(self): '''Test calculating generation numbers..''' ped = fp.read_pedigree(TestFamPlot.__PEDIGREE_UNBALANCED) ped_info = fp.PedigreeInfo(ped) cp = fp.CoordParams() cp.algorithm = 'default' fp.compute_coords(ped_info, cp) assert_equal(ped_info.gen_dict, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 2, 7: 2, 8: 3 }, 'Wrong generation numbers')