def METHOD_NAME(self, cache_name, miss_fn):
    self.assertEqual(cache_name, "mycache")
    cache = mock.Mock(name="mycache")
    if self.cache_get_raises_exception:
        def ex(key):
            raise RuntimeError("cache.get called unexpectedly")
        cache.get = ex
    else:
        cache.get = miss_fn
    return cache