| Crates.io | test-assets-ureq |
| lib.rs | test-assets-ureq |
| version | 0.6.0 |
| created_at | 2024-11-09 21:48:13.605662+00 |
| updated_at | 2025-12-22 03:49:29.526565+00 |
| description | Download test assets with ureq, managing them outside of git |
| homepage | |
| repository | https://github.com/wcampbell0x2a/test-assets-ureq |
| max_upload_size | |
| id | 1442394 |
| size | 96,669 |
Download test assets, managing them outside of git.
Changes from being a fork of test-assets:
ureq and avoid compiling curl for test binaries.toml asset definition filedlCompiler support: requires rustc 1.82+
Add the following to your Cargo.toml file:
[dependencies]
test-assets-ureq = "0.6.0"
For example, add the following information into the project toml file.
[test_assets.test_00]
filepath = "out.squashfs"
hash = "976c1638d8c1ba8014de6c64b196cbd70a5acf031be10a8e7f649536193c8e78"
url = "https://wcampbell.dev/squashfs/testing/test_00/out.squashfs"
In your rust code, add the following to download using that previous file.
let file_content = fs::read_to_string("test.toml").unwrap();
let parsed: TestAsset = toml::de::from_str(&file_content).unwrap();
let assets = parsed.values();
dl_test_files_backoff(&assets, "test-assets", true, Duration::from_secs(1)).unwrap();
If test-assets are needed outside of the Rust code, a binary is provided to download them. See the latest release.
Usage: dl [OPTIONS] <FILE> <PATH>
Arguments:
<FILE> Path to the TOML file to read
<PATH> Base path to write downloaded files
Options:
--assets <ASSETS> List of specific asset names to download (downloads all if not specified)
-h, --help Print help