From 8ce133449df6cc11a8bd94c3e4486e4ff5cff682 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 31 Aug 2020 22:09:25 -0700 Subject: [PATCH] test for time with keep_roots --- python/tests/test_topology.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/python/tests/test_topology.py b/python/tests/test_topology.py index cb0eda6f9c..da410eb38e 100644 --- a/python/tests/test_topology.py +++ b/python/tests/test_topology.py @@ -3228,19 +3228,22 @@ def test_map_mutations_with_and_without_roots(self): id is_sample time 0 1 0 1 0 1 + 2 0 2 """ edges_before = """\ left right parent child 0 2 1 0 + 0 2 2 1 """ sites = """\ id position ancestral_state 0 1.0 0 """ mutations_before = """\ - site node derived_state - 0 0 2 - 0 1 1 + site node derived_state time + 0 0 2 0 + 0 1 1 1 + 0 2 3 2 """ # expected result without keep_input_roots nodes_after = """\ @@ -3251,20 +3254,26 @@ def test_map_mutations_with_and_without_roots(self): left right parent child """ mutations_after = """\ - site node derived_state - 0 0 2 - 0 0 1 + site node derived_state time + 0 0 2 0 + 0 0 1 1 + 0 0 3 2 """ # expected result with keep_input_roots - nodes_after_keep = nodes_before + nodes_after_keep = """\ + id is_sample time + 0 1 0 + 1 0 2 + """ edges_after_keep = """\ left right parent child 0 2 1 0 """ mutations_after_keep = """\ - site node derived_state - 0 0 2 - 0 0 1 + site node derived_state time + 0 0 2 0 + 0 0 1 1 + 0 1 3 2 """ self.verify_simplify( samples=[0],