Skip to content

Commit

Permalink
fixup! Modified sibling/parent check to only test for children in one…
Browse files Browse the repository at this point in the history
… direction
  • Loading branch information
nyee committed Aug 23, 2016
1 parent b4206f2 commit e9d18b6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions testing/databaseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ def kinetics_checkChildParentRelationships(self, family_name):
def kinetics_checkSiblingsForParents(self, family_name):
"""
This test checks that siblings in a tree are not actually parent/child
See general_checkSiblingsForParents comments for more detailed description
of the test.
"""
from rmgpy.data.base import Database
originalFamily = self.database.kinetics.families[family_name]
Expand All @@ -334,12 +337,8 @@ def kinetics_checkSiblingsForParents(self, family_name):
if node in originalFamily.forwardTemplate.products: continue
for index, child1 in enumerate(node.children):
for child2 in node.children[index+1:]:
#Don't check a node against itself
if child1 is child2: continue
nose.tools.assert_false(family.matchNodeToChild(child1, child2),
"In family {0}, node {1} is a parent of {2}, but they are written as siblings.".format(family_name, child1, child2))
nose.tools.assert_false(family.matchNodeToChild(child2, child1),
"In family {0}, node {1} is a parent of {2}, but they are written as siblings.".format(family_name, child2, child1))

def kinetics_checkAdjlistsNonidentical(self, database):
"""
Expand Down

0 comments on commit e9d18b6

Please sign in to comment.