Expand description
Test utilities for database testing.
These functions provide convenient ways to set up test data in the database for integration and unit tests.
§Builder Pattern
For ergonomic test setup, use TestCrateBuilder:
ⓘ
TestCrateBuilder::new(test_db)
.name("mycrate")
.owner("admin")
.version("1.0.0")
.build()
.await
.unwrap();Structs§
- Test
Crate Builder - A builder for creating test crates with a fluent API.
Functions§
- add_
multiple_ versions - Add multiple versions of a crate at once.
- clean_
db - Clean database by removing old sessions.
- default_
created - Returns a standard test date for consistent test data.
- get_
crate_ meta_ list - Get crate meta list by crate ID.
- test_
add_ cached_ crate - Add a cached crate for testing.
- test_
add_ cached_ crate_ with_ downloads - Add a cached crate with a specified download count.
- test_
add_ crate - Add a test crate.
- test_
add_ crate_ meta - Add test crate metadata.
- test_
add_ crate_ with_ downloads - Add a test crate with a specified download count.
- test_
delete_ crate_ index - Delete crate index entries for testing.