Utilities#

quart_uploads.TestingFileStorage(stream: IO[bytes] | None = None, filename: str | None = None, name: str | None = None, content_type: str | None = None, content_length: int | None = None, headers: Headers | None = None) None#

This is a helper for testing upload behavior in your application. You can manually create it, and its save method is overloaded to set saved to the name of the file it was saved to. All of these parameters are optional, so only bother setting the ones relevant to your application.

Parameters:
  • stream – A stream. The default is an empty stream.

  • filename – The filename uploaded from the client. The default is the stream’s name.

  • name – The name of the form field it was loaded from. The default is None.

  • content_type – The content type it was uploaded as. The default is application/octet-stream.

  • content_length – How long it is. The default is -1.

  • headers – Multipart headers as a werkzeug.Headers. The default is

  • None.