From e2ea26e825039db01ecee47b5a52c646e0efea2a Mon Sep 17 00:00:00 2001 From: Yan Wong Date: Thu, 7 Mar 2024 18:56:57 +0000 Subject: [PATCH] Add test for infinite time parents --- tests/test_tables.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_tables.py b/tests/test_tables.py index 9bf5d98..b9524e4 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -253,6 +253,17 @@ def test_bad_add_iedge_row(self): 0, 1, 0, 1, child=0, parent=1, validate_node_times=True ) + def test_parent_child_at_inf(self): + tables = gigl.Tables() + tables.nodes.add_row(time=np.inf) + tables.nodes.add_row(time=np.inf) + tables.nodes.add_row(time=0) + with pytest.raises(ValueError, match="not less than parent time"): + tables.add_iedge_row( + 0, 1, 0, 1, child=0, parent=1, validate_node_times=True + ) + tables.add_iedge_row(0, 1, 0, 1, child=2, parent=1, validate_node_times=True) + def test_child_iterator(self, all_sv_types_re_gig): tables = all_sv_types_re_gig.tables assert tables.iedges.flags == gigl.VALID_GIG