Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    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)