refactor(test): move existing gpodder_sqlite tests into a separate crate
This refactor allows new implementations of the store contract to reuse the same tests, ensuring all implementations support the same behavior.
This commit is contained in:
parent
8954104954
commit
8498fe9661
10 changed files with 89 additions and 89 deletions
|
|
@ -249,3 +249,32 @@ impl gpodder::GpodderAuthStore for SqliteRepository {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::SqliteRepository;
|
||||
|
||||
#[test]
|
||||
fn test_create_user() {
|
||||
let store = SqliteRepository::in_memory().unwrap();
|
||||
gpodder_test::auth::test_create_user(store);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_remove_session() {
|
||||
let store = SqliteRepository::in_memory().unwrap();
|
||||
gpodder_test::auth::test_remove_session(store);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_refresh_session() {
|
||||
let store = SqliteRepository::in_memory().unwrap();
|
||||
gpodder_test::auth::test_refresh_session(store);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_remove_old_sessions() {
|
||||
let store = SqliteRepository::in_memory().unwrap();
|
||||
gpodder_test::auth::test_remove_old_sessions(store);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,3 +297,14 @@ impl gpodder::GpodderDeviceStore for SqliteRepository {
|
|||
.map_err(AuthErr::from)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::SqliteRepository;
|
||||
|
||||
#[test]
|
||||
fn test_insert_devices() {
|
||||
let store = SqliteRepository::in_memory().unwrap();
|
||||
gpodder_test::device::test_insert_devices(store);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue