def test_can_only_add_structures(self): structure = AtomicStructure(self.atom1, self.atom2) with self.assertRaises(TypeError): structure.add("self.chain4")
def test_can_add_structure(self, mock_add): structure = AtomicStructure(self.atom1, self.atom2) other = Mock(AtomicStructure) other._atoms = {self.atom3} structure.add(other) mock_add.assert_called_with(self.atom3)