Skip to content

Commit 6fcf626

Browse files
committed
modify test
1 parent 56a41c5 commit 6fcf626

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/test_viz.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,16 @@ def test_layers(self, helpers, tangled_tree):
8282
layers_str = tangled_tree.get_tangled_tree_layers(save_file=False)[0]
8383

8484
# Define what we expect the layers list to be.
85-
expected_layers_list = [
86-
[
85+
expected_layers_list = [[
8786
{
8887
"id": "Patient",
8988
"parents": [],
9089
"direct_children": [
9190
"Biospecimen"
9291
],
9392
"children": [
93+
"BulkRNA-seqAssay",
9494
"Biospecimen",
95-
"BulkRNA-seqAssay"
9695
]
9796
}
9897
],
@@ -122,8 +121,15 @@ def test_layers(self, helpers, tangled_tree):
122121
]
123122
]
124123

124+
125125
# Get actual layers.
126126
actual_layers_list = json.loads(layers_str)
127127

128-
# Check.
129-
assert actual_layers_list == expected_layers_list
128+
# compare
129+
for index, item in enumerate(actual_layers_list):
130+
assert item[0]["id"] == expected_layers_list[index][0]["id"]
131+
assert item[0]["parents"] == expected_layers_list[index][0]["parents"]
132+
assert item[0]["direct_children"] == expected_layers_list[index][0]["direct_children"]
133+
134+
# ensure that order of children doesn't matterß
135+
assert set(item[0]["children"]) == set(expected_layers_list[index][0]["children"])

0 commit comments

Comments
 (0)