def test_dfs_4(self): mol = helium.Molecule() SMILES.read('C1CCCCC1CC.CC', mol) visitor = helium.DFSDebugVisitor() helium.depth_first_search(mol, visitor) self.compare_file('dfs4.log', visitor.output)
def test_custom_visitor(self): mol = helium.Molecule() SMILES.read('C1CCC(CC)CC1', mol) visitor = DFSTestVisitor() helium.depth_first_search(mol, visitor) self.compare_file('dfs2.log', visitor.output)
def test_bond_order_visitor(self): mol = helium.Molecule() SMILES.read('CCC', mol) visitor = helium.DFSBondOrderVisitor() helium.depth_first_search(mol, visitor) self.assertListEqual([0, 1], visitor.bonds)
def test_closure_recorder_visitor(self): mol = helium.Molecule() SMILES.read('C1CCCCC1', mol) visitor = helium.DFSClosureRecorderVisitor() helium.depth_first_search(mol, visitor) self.assertListEqual([5], visitor.back_bonds)
def test_atom_order_visitor(self): mol = helium.Molecule() SMILES.read('CCC', mol) visitor = helium.DFSAtomOrderVisitor() helium.depth_first_search(mol, visitor) self.assertListEqual([0, 1, 2], visitor.atoms)