def test_methane(self): smi = 'C' mol = Molecule().from_smiles(smi) p_indices = [] _reset_lone_pairs(mol, p_indices) for at in mol.atoms: self.assertEquals(at.lone_pairs, 0)
def test_singlet_methylene(self): adjlist = """ multiplicity 1 1 C u0 p1 c0 {2,S} {3,S} 2 H u0 p0 c0 {1,S} 3 H u0 p0 c0 {1,S} """ mol = Molecule().from_adjacency_list(adjlist) p_indices = [1] _reset_lone_pairs(mol, p_indices) for at in mol.atoms: if at.symbol == 'C': self.assertEquals(at.lone_pairs, 1) else: self.assertEquals(at.lone_pairs, 0)