Пример #1
0
def test_json():
    p = Ped(op.join(HERE, 'peddy/tests/test.mendel.ped'))
    json = p.to_json()
    #expected = '[{"maternal_id": "-9", "paternal_id": "-9", "sex": "male", "family_id": "CEPH1463", "phenotype": "affected", "sample_id": "NA12889"}, {"maternal_id": "-9", "paternal_id": "-9", "sex": "female", "family_id": "CEPH1463", "phenotype": "affected", "sample_id": "NA12890"}, {"maternal_id": "NA12890", "paternal_id": "NA12889", "sex": "male", "family_id": "CEPH1463", "phenotype": "affected", "sample_id": "NA12877"}]'
    # this test may fail if order of dicts is changed
    assert "CEPH1463" in json, json
Пример #2
0
def test_json():
    p = Ped(op.join(HERE, 'peddy/tests/test.mendel.ped'))
    json = p.to_json()
    #expected = '[{"maternal_id": "-9", "paternal_id": "-9", "sex": "male", "family_id": "CEPH1463", "phenotype": "affected", "sample_id": "NA12889"}, {"maternal_id": "-9", "paternal_id": "-9", "sex": "female", "family_id": "CEPH1463", "phenotype": "affected", "sample_id": "NA12890"}, {"maternal_id": "NA12890", "paternal_id": "NA12889", "sex": "male", "family_id": "CEPH1463", "phenotype": "affected", "sample_id": "NA12877"}]'
    # this test may fail if order of dicts is changed
    assert "CEPH1463" in json, json