def test_cache_set(monkeypatch):
cache = IgnoreTooLargePyMemcacheCache("notarealserver", {})
monkeypatch.setattr(PyMemcacheCache, "set", lambda *args, **kwargs: None)
cache.set("key", "value")
monkeypatch.setattr(PyMemcacheCache, "set", fail_too_large)
cache.set("key", "value")
with pytest.raises(MemcacheServerError):
monkeypatch.setattr(PyMemcacheCache, "set", fail_other_error)
cache.set("key", "value")