def test_can_unbond_from_atom(self): atom = Atom("C") atom2 = Mock(_bonded_atoms={atom}) atom._bonded_atoms = {atom2} atom.unbond_from(atom2) self.assertEqual(atom._bonded_atoms, set()) self.assertEqual(atom2._bonded_atoms, set())
def test_bonded_atoms_property(self): atom = Atom("C", 2, 3, 5) atom._bonded_atoms = [1, 2, 3] self.assertEqual(atom.bonded_atoms, {1, 2, 3})