def setUp(self):
        super(TestHttpStore, self).setUp()
        self.config(default_store='http', group='glance_store')
        http.Store.READ_CHUNKSIZE = 2
        self.store = http.Store(self.conf)

        response = mock.patch('httplib.HTTPConnection.getresponse')
        self.response = response.start()
        self.response.return_value = utils.FakeHTTPResponse()
        self.addCleanup(response.stop)

        request = mock.patch('httplib.HTTPConnection.request')
        self.request = request.start()
        self.request.side_effect = lambda w, x, y, z: None
        self.addCleanup(request.stop)
Esempio n. 2
0
 def setUp(self):
     super(TestHttpStore, self).setUp()
     self.config(default_store='http', group='glance_store')
     http.Store.READ_CHUNKSIZE = 2
     self.store = http.Store(self.conf)
     self.register_store_schemes(self.store, 'http')