Initial commit
This commit is contained in:
16
tests/test_aggregate.py
Normal file
16
tests/test_aggregate.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from pathlib import Path
|
||||
|
||||
from genomic_consultant.panels.aggregate import merge_mappings
|
||||
import json
|
||||
|
||||
|
||||
def test_merge_mappings(tmp_path: Path):
|
||||
a = tmp_path / "a.json"
|
||||
b = tmp_path / "b.json"
|
||||
a.write_text('{"source":"A","phenotype_to_genes":{"HP:1":["G1","G2"]}}')
|
||||
b.write_text('{"source":"B","phenotype_to_genes":{"HP:1":["G2","G3"],"HP:2":["G4"]}}')
|
||||
out = tmp_path / "out.json"
|
||||
merge_mappings([a, b], out)
|
||||
data = json.loads(out.read_text())
|
||||
assert sorted(data["phenotype_to_genes"]["HP:1"]) == ["G1", "G2", "G3"]
|
||||
assert data["phenotype_to_genes"]["HP:2"] == ["G4"]
|
||||
Reference in New Issue
Block a user