def save(self, filename=None):
        filename = Path(filename) if filename is not None else self.filename
        with filename.open("w") as f:
            f.write(self.yaml)
def test_cache_middleware(self):
        req = Request.blank('/something', environ={'REQUEST_METHOD': 'GET'})
        resp = self.app(req.environ, start_response)
        self.assertTrue('swift.cache' in resp)
        self.assertTrue(isinstance(resp['swift.cache'], MemcacheRing))