Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
    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)
Beispiel #5
0
    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)
Beispiel #6
0
    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)
Beispiel #7
0
    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)
Beispiel #8
0
    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)
Beispiel #9
0
    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)
Beispiel #10
0
    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)