From 400604e6e02681dc490c4e36556a729260415cf4 Mon Sep 17 00:00:00 2001 From: chaewon-research Date: Sun, 13 Sep 2026 17:26:00 -0500 Subject: [PATCH] test: add default causal recovery accuracy check --- causationentropy/tests/test_discovery.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/causationentropy/tests/test_discovery.py b/causationentropy/tests/test_discovery.py index d681a99..d746a56 100644 --- a/causationentropy/tests/test_discovery.py +++ b/causationentropy/tests/test_discovery.py @@ -32,6 +32,14 @@ def test_discover_network_basic_numpy(self): assert isinstance(G, nx.MultiDiGraph) assert len(G.nodes()) == 2 + + # Assert ground-truth causal recovery (Issue #15) + edges_with_lag = { + (u, v, attrs.get("lag")) for u, v, attrs in G.edges(data=True) + } + assert ("X0", "X1", 1) in edges_with_lag + assert edges_with_lag == {("X0", "X1", 1)} + assert "X0" in G.nodes() assert "X1" in G.nodes()