Exemplo n.º 1
0
 def testProcessUniMultiReaction(self):
     if IGNORE_TEST:
         return
     games_pp2 = GAMES_PP(self.simple2)
     self.assertTrue(isinstance(games_pp2, GAMES_PP))
     reaction = games_pp2.simple.getReaction(CH2FH4toHCHO)
     reactant1 = games_pp2.simple.getMolecule(CH2FH4)
     product1 = games_pp2.simple.getMolecule(FH4)
     product2 = games_pp2.simple.getMolecule(HCHO)
     games_pp2.processUniMultiReaction(reaction)
     som_reactant1 = games_pp2.getNode(reactant1)
     som_product1 = games_pp2.getNode(product1)
     som_product2 = games_pp2.getNode(product2)
     self.assertTrue(games_pp2.has_edge(som_product1, som_reactant1))
     self.assertTrue(games_pp2.has_edge(som_product2, som_reactant1))
Exemplo n.º 2
0
 def testProcessUnequalSOMReaction(self):
     if IGNORE_TEST:
         return
     games_pp2 = GAMES_PP(self.simple2)
     self.assertTrue(len(games_pp2.edges) == 0)
     reaction = games_pp2.simple.getReaction(CH2FH4toHCHO)
     som_reaction = games_pp2.convertReactionToSOMReaction(reaction)
     games_pp2.processUnequalSOMReaction(som_reaction)
     self.assertTrue(len(games_pp2.edges) == 2)
     reactant1 = games_pp2.simple.getMolecule(FH4)
     reactant2 = games_pp2.simple.getMolecule(HCHO)
     product1 = games_pp2.simple.getMolecule(CH2FH4)
     games_pp2.processUniMultiReaction(reaction)
     som_product1 = games_pp2.getNode(product1)
     som_reactant1 = games_pp2.getNode(reactant1)
     som_reactant2 = games_pp2.getNode(reactant2)
     self.assertTrue(games_pp2.has_edge(som_reactant1, som_product1))
     self.assertTrue(games_pp2.has_edge(som_reactant2, som_product1))