Exemplo n.º 1
0
 def testAppend(self):
     if IGNORE_TEST:
         return
     moiety2 = Moiety(MOIETY_NAME2)
     molecule = Molecule(MOIETY_NAME1)
     new_molecule = molecule.append(moiety2)
     self.assertEqual(new_molecule.name, Molecule(MOLECULE_NAME).name)
Exemplo n.º 2
0
 def testGetMoietys(self):
     if IGNORE_TEST:
         return
     m_s1 = MoietyStoichiometry(Moiety(MOIETY_NAME1), NUM1)
     m_s2 = MoietyStoichiometry(MOIETY_NAME2, NUM2)
     m_s3 = MoietyStoichiometry(MOIETY_NAME1, NUM2)
     molecule = Molecule(str(m_s1))
     molecule = molecule.append(Moiety(str(m_s2)))
     moietys = molecule.getMoietys()
     expected = [Moiety(MOIETY_NAME1), Moiety(MOIETY_NAME2)]
     for moiety in moietys:
         self.assertTrue(any([moiety.isEqual(e) for e in expected]))