Skip to content

Commit

Permalink
test for time with keep_roots
Browse files Browse the repository at this point in the history
  • Loading branch information
petrelharp committed Sep 1, 2020
1 parent b50bed5 commit a9d314a
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions python/tests/test_topology.py
Expand Up @@ -3223,24 +3223,27 @@ def test_single_binary_tree_keep_roots_mutations(self):
keep_input_roots=True,
)

def test_map_mutations_with_and_without_roots(self):
def test_place_mutations_with_and_without_roots(self):
nodes_before = """\
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 = """\
Expand All @@ -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],
Expand Down

0 comments on commit a9d314a

Please sign in to comment.