Skip to content

Commit 9816b98

Browse files
committed
Codecov
1 parent d71d2d3 commit 9816b98

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/resources/data/dag.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
5+
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
6+
<graph id="G" edgedefault="directed">
7+
<node id="Z"/>
8+
<node id="X"/>
9+
<node id="M"/>
10+
<node id="Y"/>
11+
<edge source="Z" target="X"/>
12+
<edge source="X" target="M"/>
13+
<edge source="M" target="Y"/>
14+
<edge source="Z" target="M"/>
15+
</graph>
16+
</graphml>

tests/specification_tests/test_causal_dag.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ def setUp(self) -> None:
2020
with open(self.dag_dot_path, "w") as f:
2121
f.write(dag_dot)
2222

23+
def test_graphml(self):
24+
dot_dag = CausalDAG(self.dag_dot_path)
25+
xml_dag = CausalDAG(os.path.join("tests", "resources", "data", "dag.xml"))
26+
self.assertEqual(dot_dag.nodes, xml_dag.nodes)
27+
self.assertEqual(dot_dag.edges, xml_dag.edges)
28+
2329
def test_enumerate_minimal_adjustment_sets(self):
2430
"""Test whether enumerate_minimal_adjustment_sets lists all possible minimum sized adjustment sets."""
2531
causal_dag = CausalDAG(self.dag_dot_path)

0 commit comments

Comments
 (0)