Ejemplo n.º 1
0
func (*storageSuite) TestRemoveAll(c *gc.C) {
	// When we ask gwacl to remove all blobs, it calls DeleteContainer.
	response := makeResponse("", http.StatusAccepted)
	storage, transport := makeFakeStorage("cntnr", "account", "")
	transport.AddExchange(response, nil)

	err := storage.RemoveAll()
	c.Assert(err, gc.IsNil)

	_, err = storage.getStorageContext()
	c.Assert(err, gc.IsNil)
	// Without going too far into gwacl's innards, this is roughly what
	// it needs to do in order to delete a container.
	c.Assert(transport.ExchangeCount, gc.Equals, 1)
	c.Check(transport.Exchanges[0].Request.URL.String(), gc.Matches, "http.*/cntnr?.*restype=container.*")
	c.Check(transport.Exchanges[0].Request.Method, gc.Equals, "DELETE")
}
Ejemplo n.º 2
0
func (f *fileStorageWriter) RemoveAll() error {
	return storage.RemoveAll(f)
}
Ejemplo n.º 3
0
func (s *localStorage) RemoveAll() error {
	return storage.RemoveAll(s)
}