def test_getReactionURL(self):
        """
        Test whether url is only encoded once
        """

        reactant1 = Species().fromSMILES('[CH3]')
        reactant2 = Species().fromSMILES('[SH]')
        product1 = Species().fromSMILES('CS')

        reaction = Reaction(reactants=[reactant1, reactant2], products=[product1])

        url = getReactionUrl(reaction, resonance=False)

        base_url = '/database/kinetics/reaction/reactant1={0}__reactant2={1}__product1={2}__res=False'
        expected_url = iri_to_uri(base_url.format(reactant1.toAdjacencyList(),
                                                  reactant2.toAdjacencyList(),
                                                  product1.toAdjacencyList()))

        self.assertEqual(url, expected_url)
Exemplo n.º 2
0
    def test_getReactionURL(self):
        """
        Test whether url is only encoded once
        """

        reactant1 = Species().fromSMILES('[CH3]')
        reactant2 = Species().fromSMILES('[SH]')
        product1 = Species().fromSMILES('CS')

        reaction = Reaction(reactants=[reactant1, reactant2], products=[product1])

        url = getReactionUrl(reaction)

        base_url = '/database/kinetics/reaction/reactant1={0}__reactant2={1}__product1={2}'
        expected_url = iri_to_uri(base_url.format(reactant1.toAdjacencyList(),
                                                    reactant2.toAdjacencyList(),
                                                    product1.toAdjacencyList()))

        self.assertEqual(url, expected_url)