Expand description
Some helpful utilities for testing. This module is only available if the test-tools feature is
enabled. Its main feature is allowing the use of prebuilt scaffolds for testing.
See the README in
the testing directory of bindle for more information on scaffolding structure. All loading
functions will load scaffolds by default from $CARGO_MANIFEST_DIR/tests/scaffolds. However,
this directory can be configured by setting the BINDLE_SCAFFOLD_DIR environment variable to
your desired path. All functions will panic if they encounter an error to make it easier on
users (so they don’t have to handle the errors in their tests in the exact same way)
Structs§
- Mock
KeyStore - Parcel
Info - A struct containing the SHA of the data and the data as bytes
- RawScaffold
- A scaffold loaded from disk, containing the raw bytes for all files in the bindle.
- Scaffold
- A scaffold loaded from disk, containing the bindle object representations for all files in the bindle (except for the parcels themselves, as they can be binary data).
Constants§
- SCAFFOLD_
DIR_ ENV - The environment variable name used for setting the scaffolds directory
Functions§
- load_
all_ files - Loads all scaffolds in the scaffolds directory, returning them as a hashmap with the directory
name as the key and a
RawScaffoldas a value. There is not an equivalent for loading all scaffolds as aScaffoldobject, because some of them may be invalid on will not deserialize properly - setup
- Returns a file
Providerimplementation configured with a temporary directory, strict Search implementation, and a mock key store for use in testing API endpoints - setup_
embedded - Returns an embedded
Providerimplementation configured with a temporary directory, strict Search implementation, and a mock key store for use in testing API endpoints