d.addCallback(lambda (response, body): body)
return d
+ def _create(self):
+ """
+ Create the container.
+ """
+ url = self._make_container_url(self.URI)
+ url += "?restype=container"
+ d = self._authorized_http_request("MS Azure PUT container", 'PUT',
+ url, {}, body=None,
+ need_response_body=False)
+ d.addCallback(lambda (response, body): body)
+ return d
+
def configure_msazure_container(storedir, config):
"""
http_response.callback((self.Response(200), None))
self.failUnless(done)
+ def test_create_container(self):
+ """
+ MSAzureStorageContainer.create() send the appropriate HTTP command to
+ create the container (aka bucket).
+ """
+ http_response = self.mock_http_request()
+ done = []
+ self.container.create().addCallback(done.append)
+ self.failIf(done)
+ self.container._http_request.assert_called_once_with(
+ "MS Azure PUT container", "PUT",
+ "https://theaccount.blob.core.windows.net/thebucket?restype=container",
+ {"Authorization": [self.authorization],
+ "x-ms-version": ["2012-02-12"],
+ "x-ms-date": [self.date],
+ },
+ body=None,
+ need_response_body=False)
+ http_response.callback((self.Response(200), None))
+ self.failUnless(done)
+
class ServerMixin:
def allocate(self, account, storage_index, sharenums, size, canary=None):