def METHOD_NAME(self):
    """
    Failure path when setting an item.
    """
    def _writeFail(path, data):
        path.setContent(data)
        raise OSError("fail to write")
    self.dbm[b"failkey"] = b"test"
    self.patch(self.dbm, "_writeFile", _writeFail)
    self.assertRaises(IOError, self.dbm.__setitem__, b"failkey", b"test2")