Skip to content

Commit

Permalink
fixup of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petrelharp committed Aug 4, 2023
1 parent eb1fe32 commit 0f0cf3d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions python/tests/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -8654,12 +8654,12 @@ def verify_extend_edges(self, ts):

for e in ets.edges():
# e should be in old_edges,
# but with expanded limits
# but with modified limits
k = (e.parent, e.child)
assert k in old_edges
overlaps = False
for (l, r) in old_edges[k]:
if (l >= e.left) and (r <= e.right):
if (l <= e.right) and (r >= e.left):
overlaps = True
assert overlaps

Expand Down Expand Up @@ -8774,8 +8774,20 @@ def test_simple_ex(self):
assert t.parent(8) == 6
self.verify_extend_edges(ts)

def test_extend_edges(self):
tables = wf.wf_sim(5, 20, deep_history=False, seed=3)
def test_wright_fisher_trees(self):
tables = wf.wf_sim(N=5, ngens=20, deep_history=False, seed=3)
tables.sort()
ts = tables.tree_sequence().simplify()
self.verify_extend_edges(ts)

def test_wright_fisher_trees_unsimplified(self):
tables = wf.wf_sim(N=6, ngens=22, deep_history=False, seed=4)
tables.sort()
ts = tables.tree_sequence()
self.verify_extend_edges(ts)

def test_wright_fisher_trees_with_history(self):
tables = wf.wf_sim(N=8, ngens=15, deep_history=True, seed=5)
tables.sort()
ts = tables.tree_sequence()
self.verify_extend_edges(ts)

0 comments on commit 0f0cf3d

Please sign in to comment.