def test_atoms(self): for d in self.good_data: m = Molecule(d[1]) for (symbol, count) in d[3]: self.assertEqual(count, m.atoms(symbol), msg="atom {} in {}".format(symbol, m))
def test_atomserror(self): m = Molecule('Be3Al2(SiO3)6') with self.assertRaises(KeyError): m.atoms('Ck')
def test_atomsbad(self): m = Molecule('Be3Al2(SiO3)6') self.assertEqual(0, m.atoms('Ca'))