def test_bfs_4(self): mol = helium.Molecule() SMILES.read('C1CCC(CC)CC1', mol) visitor = helium.BFSDebugVisitor() helium.breadth_first_search(mol, mol.atom(5), visitor) self.compare_file('bfs4.log', visitor.output)
def test_closure_recorder_visitor(self): mol = helium.Molecule() SMILES.read('C1CCCCC1', mol) visitor = helium.BFSClosureRecorderVisitor() helium.breadth_first_search(mol, visitor) self.assertListEqual([3], visitor.back_bonds)
def test_custom_visitor(self): mol = helium.Molecule() SMILES.read('C1CCC(CC)CC1', mol) visitor = BFSTestVisitor() helium.breadth_first_search(mol, visitor) self.compare_file('bfs1.log', visitor.output)
def test_atom_order_visitor(self): mol = helium.Molecule() SMILES.read('CCC', mol) visitor = helium.BFSAtomOrderVisitor() helium.breadth_first_search(mol, visitor) self.assertListEqual([0, 1, 2], visitor.atoms)
def test_bond_order_visitor(self): mol = helium.Molecule() SMILES.read('CCC', mol) visitor = helium.BFSBondOrderVisitor() helium.breadth_first_search(mol, visitor) self.assertListEqual([0, 1], visitor.bonds)