file
Classes:
-
FileStorage–A storage backend for testing that saves data to local files.
Attributes:
-
file_storage–Default instance of FileStorage whose directory is deleted when the process exits.
file_storage
module-attribute
file_storage = FileStorage(
LABOX_USER_PROC_CACHE_DIR / __name__, mkdir=True
)
Default instance of FileStorage whose directory is deleted when the process exits.
FileStorage
A storage backend for testing that saves data to local files.
Methods:
-
deserialize_config–Deserialize the configuration from a JSON string.
-
read_data–Load data from the given location.
-
read_data_stream–Load a stream of data from the given location.
-
serialize_config–Serialize the configuration to a JSON string.
-
write_data–Save the given data.
-
write_data_stream–Save the given data stream.
deserialize_config
deserialize_config(config: str) -> C
Deserialize the configuration from a JSON string.
read_data_stream
async
read_data_stream(location: str) -> AsyncGenerator[bytes]
Load a stream of data from the given location.
write_data
async
Save the given data.
write_data_stream
async
write_data_stream(
data_stream: AsyncIterable[bytes],
get_digest: GetStreamDigest,
_tags: TagMap,
) -> str
Save the given data stream.