File size: 1,935 Bytes
be59fdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import ClickReaction
from tests import TestHelper


class CuAACTest(TestHelper.ReactionTestCase):
    reactant_names = ["alkyne", "azide"]

    def setUp(self):
        self.set_reaction(ClickReaction.CuAAC)

    def test_one_product(self):
        reactants = [
            # S
            (("CC#C", "C-N=[N+]=[N-]"), "Cn1cc(C)nn1"),
            (("CC#C", "C-[N-]-[N+]#N"), "Cn1cc(C)nn1"),
            (("CC#CI", "C-[N-]-[N+]#N"), "Cn1c(I)c(C)nn1"),
            (("c1ccccc1C#C", "C-[N-]-[N+]#N"), "Cn1cc(-c2ccccc2)nn1"),
        ]

        self._test_one_product(reactants, self.reactant_names)

    def test_no_product(self):
        reactants = [
            # Non-terminal alkynes
            ("CC#CC", "C-N=[N+]=[N-]"),
            ("CC#Cc1ccccc1", "C-N=[N+]=[N-]"),
            ("c1ccccc1C#Cc1ccccc1", "C-N=[N+]=[N-]"),
            ("C1CCCC#CCC1", "C-N=[N+]=[N-]"),
        ]

        self._test_no_product(reactants, self.reactant_names)

    def test_if_get_products_returns_all_possible_products(self):
        reactants = [
            (("C#CC#C", "C-N=[N+]=[N-]"), ("C#Cc1cn(C)nn1", "C#Cc1cn(C)nn1")),
            (("C#CCC#CI", "C-N=[N+]=[N-]"), ("IC#CCc1cn(C)nn1", "C#CCC(N=NN1C)=C1I")),
        ]

        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 = [
            (("C#C", "C-N=[N+]=[N-]"), ["Cn1ccnn1"]),
            (("C#C", "C-[N-]-[N+]#N"), ["Cn1ccnn1"]),
        ]

        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 = [
            (("C#C", "C-N=[N+]=[N-]"), "Cn1ccnn1"),
            (("C#C", "C-[N-]-[N+]#N"), "Cn1ccnn1"),
        ]

        self._test_one_product(reactants, self.reactant_names, symmetrical_as_one=True)