| | import ClickReaction |
| | from tests import TestHelper |
| |
|
| |
|
| | class AmideCouplingTest(TestHelper.ReactionTestCase): |
| | reactant_names = ["amine", "acid"] |
| |
|
| | def setUp(self): |
| | self.set_reaction(ClickReaction.AmideCoupling) |
| |
|
| | def test_one_product(self): |
| | reactants = [ |
| | |
| | (("N", "OC(C)=O"), "O=C(C)N"), |
| | (("[NH4+]", "OC(C)=O"), "O=C(C)N"), |
| | (("N(-[H])(-[H])(-[H])", "OC(C)=O"), "O=C(C)N"), |
| |
|
| | |
| | (("CN", "OC=O"), "CNC=O"), |
| | (("CCN", "OC(C)=O"), "O=C(C)NCC"), |
| | (("CN", "OC(C1=CC=CC=C1)=O"), "O=C(C1=CC=CC=C1)NC"), |
| | (("NC1=CC=CC(CN)=C1", "OC(C)=O"), "NC1=CC=CC(CNC(C)=O)=C1"), |
| |
|
| | |
| | (("CNC", "OC(C)=O"), "O=C(C)N(C)C"), |
| |
|
| | |
| | (("CC[NH3+]", "OC(C)=O"), "O=C(C)NCC"), |
| |
|
| | |
| | (("C[NH2+]C", "OC(C)=O"), "O=C(C)N(C)C"), |
| |
|
| | |
| | (("CCN", "[O-]C(C)=O"), "O=C(C)NCC"), |
| |
|
| | |
| | (("C[NH2+]C", "[O-]C(C(C1=CC=CC=C1)(F)Cl)=O"), "O=C(C(C1=CC=CC=C1)(F)Cl)N(C)C"), |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | (("CCN", "CCC(ON1C(CCC1=O)=O)=O"), "CCC(NCC)=O"), |
| | |
| | (("CCN", "CCC(ON1C(CC(S(=O)(O)=O)C1=O)=O)=O"), "CCC(NCC)=O"), |
| | |
| | (("CCN", "CCC(OC1=CC=C([N+]([O-])=O)C=C1)=O"), "CCC(NCC)=O"), |
| | |
| | (("CCN", "CCC(OC1=C(F)C(F)=C(F)C(F)=C1F)=O"), "CCC(NCC)=O"), |
| |
|
| | ] |
| |
|
| | self._test_one_product(reactants, self.reactant_names) |
| |
|
| | |
| | def test_no_product(self): |
| | reactants = [ |
| | |
| | ("NC(C)=O", "OC(C)=O"), |
| | |
| | ("CC(NC)=O", "OC(C)=O"), |
| | |
| | ("NC(NC)=O", "OC(C)=O"), |
| | |
| | ("O=C(OC)NC", "OC(C)=O"), |
| | |
| | ("CC(NC(C)=O)=O", "OC(C)=O"), |
| | |
| | ("NC1=CC=CC=C1", "OC(C1=CC=CC=C1)=O"), |
| | |
| | ("CN(C)C", "OC(C)=O"), |
| | |
| | ("NC(=N)N", "OC(C)=O") |
| | ] |
| |
|
| | self._test_no_product(reactants, self.reactant_names) |
| |
|
| | |
| | def test_if_get_products_returns_all_possible_products(self): |
| | reactants = [ |
| | (("NCCNC", "OC(C)=O"), ("CNCCNC(C)=O", "NCCN(C(C)=O)C")), |
| | (("CNCCNC", "OC(C)=O"), ("CNCCN(C)C(C)=O", "CNCCN(C)C(C)=O")), |
| | (("N", "OC(CN(CC(O)=O)CCN(CC(O)=O)CC(O)=O)=O"), ["OC(CN(CC(O)=O)CCN(CC(N)=O)CC(O)=O)=O"]*4), |
| | ] |
| |
|
| | self._test_all_possible_products(reactants, self.reactant_names) |
| |
|
| | def test_if_get_products_returns_only_1_products_if_symmetrical_as_one_is_true(self): |
| | reactants = [ |
| | (("NCCNC", "OC(C)=O"), ["CNCCNC(C)=O", "NCCN(C(C)=O)C"]), |
| | (("CNCCNC", "OC(C)=O"), ["CNCCN(C)C(C)=O"]), |
| | (("N", "OC(CN(CC(O)=O)CCN(CC(O)=O)CC(O)=O)=O"), ["OC(CN(CC(O)=O)CCN(CC(N)=O)CC(O)=O)=O"]), |
| | ] |
| |
|
| | self._test_all_possible_products(reactants, self.reactant_names, symmetrical_as_one=True) |
| |
|
| | def test_if_get_product_returns_the_symmetric_product_if_symmetrical_as_one_is_true(self): |
| | reactants = [ |
| | (("CNCCNC", "OC(C)=O"), "CNCCN(C)C(C)=O"), |
| | (("N", "OC(CN(CC(O)=O)CCN(CC(O)=O)CC(O)=O)=O"), "OC(CN(CC(O)=O)CCN(CC(N)=O)CC(O)=O)=O"), |
| | ] |
| |
|
| | self._test_one_product(reactants, self.reactant_names, symmetrical_as_one=True) |
| |
|