Commit b82c96d6 authored by Yoann Dufresne's avatar Yoann Dufresne
Browse files

update tests

parent 04e7e460
......@@ -33,13 +33,11 @@ class TestD2Graph(unittest.TestCase):
else:
self.assertEqual(1, len(d2.index[dmer]))
def test_linear_d2_construction(self):
for d in range(1, 10):
size = 2 * d + 3
index_k = 2 * d - 1
G = gm.generate_d_graph_chain(size, d)
d2 = D2Graph(G)
d2.construct_from_barcodes(index_size=index_k, verbose=False)
......@@ -49,7 +47,7 @@ class TestD2Graph(unittest.TestCase):
self.assertEqual(awaited_d_num, len(d2.all_d_graphs))
# Test index
awaited_index_size = comb(2*d+1, index_k) + (size - (2*d+1)) * comb(2*d, index_k-1)
awaited_index_size = comb(2 * d + 1, index_k) + (size - (2 * d + 1)) * comb(2 * d, index_k - 1)
if len(d2.index) != awaited_index_size:
dmers = [list(x) for x in d2.index]
dmers = [str(x) for x in dmers if len(x) != len(frozenset(x))]
......@@ -59,13 +57,13 @@ class TestD2Graph(unittest.TestCase):
# Test connectivity
# Center node names
c1 = d
c2 = d+1
c3 = d+2
c2 = d + 1
c3 = d + 2
# Connectivity matrix
awaited_distances = {
c1:{c2:2, c3:4},
c2:{c1:2, c3:2},
c3:{c1:4, c2:2}
c1: {c2: 2, c3: 4},
c2: {c1: 2, c3: 2},
c3: {c1: 4, c2: 2}
}
for x, y, data in d2.edges(data=True):
......@@ -85,7 +83,6 @@ class TestD2Graph(unittest.TestCase):
# awaited_dist = awaited_distances[dg1.center][dg2.center]
# self.assertEqual(dist, awaited_dist)
def test_reloading(self):
# Parameters
d = 3
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment