Beispiel #1
0
 def test_split(self):
     self.atomN.add_connected(self.atomC3)
     self.atomC3.add_connected(self.atomC2)
     self.atomC2.add_connected(self.atomC1, 2)
     mol = stub_mol([self.atomC1, self.atomC2, self.atomC3, self.atomN])
     result = molecule_splitter.split(mol)
     expected = {"CH2=CH": 1, "CH2NH2": 1}
     self.assertEqual(result, expected)
 def test_split(self):
     self.atomN.add_connected(self.atomC3)
     self.atomC3.add_connected(self.atomC2)
     self.atomC2.add_connected(self.atomC1, 2)
     mol = stub_mol([self.atomC1, self.atomC2, self.atomC3, self.atomN])
     result = molecule_splitter.split(mol)
     expected = {"CH2=CH": 1, "CH2NH2": 1}
     self.assertEqual(result, expected)
Beispiel #3
0
    def test_split1(self):
        # construct propan-2-ole
        self.atomC1.add_connected(self.atomO)
        self.atomC1.add_connected(self.atomC2)
        self.atomC1.add_connected(self.atomC3)
        mol = stub_mol([self.atomC1, self.atomC2, self.atomC3, self.atomO])

        result = molecule_splitter.split(mol)
        expected = {"CH3": 2, "CH": 1, "OH": 1}
        self.assertEqual(result, expected)
    def test_split1(self):
        # construct propan-2-ole
        self.atomC1.add_connected(self.atomO)
        self.atomC1.add_connected(self.atomC2)
        self.atomC1.add_connected(self.atomC3)
        mol = stub_mol([self.atomC1, self.atomC2, self.atomC3, self.atomO])

        result = molecule_splitter.split(mol)
        expected = {"CH3": 2, "CH": 1, "OH": 1}
        self.assertEqual(result, expected)
Beispiel #5
0
    def test_split2(self):
        # construct cyclobutane
        atomC = Atom("C")
        atomC.add_connected(self.atomC1)
        self.atomC1.add_connected(self.atomC2)
        self.atomC2.add_connected(self.atomC3)
        self.atomC3.add_connected(atomC)
        mol = stub_mol([self.atomC1, atomC, self.atomC2, self.atomC3])

        result = molecule_splitter.split(mol)
        expected = {"CH2": 4}
        self.assertEqual(result, expected)
    def test_split2(self):
        # construct cyclobutane
        atomC = Atom("C")
        atomC.add_connected(self.atomC1)
        self.atomC1.add_connected(self.atomC2)
        self.atomC2.add_connected(self.atomC3)
        self.atomC3.add_connected(atomC)
        mol = stub_mol([self.atomC1, atomC, self.atomC2, self.atomC3])

        result = molecule_splitter.split(mol)
        expected = {"CH2": 4}
        self.assertEqual(result, expected)