Beispiel #1
0
def test_wrong_relations():
    """docstring for test_wrong_relations"""
    # GIVEN a individual with correct family info
    sample_info = {
        'sample_id': '1',
        'sex': 'male',
        'phenotype': 'affected',
        'mother': '3',
        'father': '2'
    }
    mother_info = {
        'sample_id': '3',
        'sex': 'female',
        'phenotype': 'unaffected',
        'mother': '0',
        'father': '0'
    }
    father_info = {
        'sample_id': '2',
        'sex': 'male',
        'phenotype': 'unaffected',
        'mother': '0',
        'father': '0'
    }
    samples = [sample_info, mother_info, father_info]
    # Nothong should happend here
    assert parse_individuals(samples)

    # WHEN changing mother id in proband
    sample_info['mother'] = '5'
    # THEN a PedigreeError should be raised
    with pytest.raises(PedigreeError):
        parse_individuals(samples)
Beispiel #2
0
def test_no_individuals():
    # GIVEN a list with no indioviduals
    samples = []
    # WHEN parsing the individuals
    with pytest.raises(PedigreeError):
        # THEN error should be raised since a family has to have individuals
        parse_individuals(samples)
def test_wrong_relations():
    """docstring for test_wrong_relations"""
    # GIVEN a individual with correct family info
    sample_info = {
        'sample_id': '1',
        'sex': 'male',
        'phenotype': 'affected',
        'mother': '3',
        'father': '2'
    }
    mother_info = {
        'sample_id': '3',
        'sex': 'female',
        'phenotype': 'unaffected',
        'mother': '0',
        'father': '0'
    }
    father_info = {
        'sample_id': '2',
        'sex': 'male',
        'phenotype': 'unaffected',
        'mother': '0',
        'father': '0'
    }
    samples = [sample_info, mother_info, father_info]
    # Nothong should happend here
    assert parse_individuals(samples)

    # WHEN changing mother id in proband
    sample_info['mother'] = '5'
    # THEN a PedigreeError should be raised
    with pytest.raises(PedigreeError):
        parse_individuals(samples)
Beispiel #4
0
def test_wrong_relations():
    """docstring for test_wrong_relations"""
    # GIVEN a individual with correct family info
    sample_info = {
        "sample_id": "1",
        "sex": "male",
        "phenotype": "affected",
        "mother": "3",
        "father": "2",
    }
    mother_info = {
        "sample_id": "3",
        "sex": "female",
        "phenotype": "unaffected",
        "mother": "0",
        "father": "0",
    }
    father_info = {
        "sample_id": "2",
        "sex": "male",
        "phenotype": "unaffected",
        "mother": "0",
        "father": "0",
    }
    samples = [sample_info, mother_info, father_info]
    # Nothong should happend here
    assert parse_individuals(samples)

    # WHEN changing mother id in proband
    sample_info["mother"] = "5"
    # THEN a PedigreeError should be raised
    with pytest.raises(PedigreeError):
        parse_individuals(samples)
def test_no_individuals():
    # GIVEN a list with no indioviduals
    samples = []
    # WHEN parsing the individuals
    with pytest.raises(PedigreeError):
        # THEN error should be raised since a family has to have individuals
        parse_individuals(samples)