diff options
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r-- | src/database/mod.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs index d6b7dd6..943a1ad 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -6,7 +6,7 @@ use crate::indieauth::User; mod redis; pub use crate::database::redis::RedisStorage; #[cfg(test)] -pub use redis::tests::get_redis_instance; +pub use redis::tests::{RedisInstance, get_redis_instance}; #[derive(Serialize, Deserialize, PartialEq, Debug)] pub struct MicropubChannel { @@ -222,18 +222,14 @@ mod tests { #[async_std::test] async fn test_redis_storage_basic_operations() { - let (tempdir, mut redis, uri) = get_redis_instance().await; - let backend = super::RedisStorage::new(uri).await.unwrap(); + let redis_instance = get_redis_instance().await; + let backend = super::RedisStorage::new(redis_instance.uri().to_string()).await.unwrap(); test_backend_basic_operations(backend).await; - redis.kill().expect("Redis wasn't running"); - drop(tempdir); } #[async_std::test] - async fn test_redis_storage_channel_support() { - let (tempdir, mut redis, uri) = get_redis_instance().await; - let backend = super::RedisStorage::new(uri).await.unwrap(); + async fn test_redis_storage_channel_list() { + let redis_instance = get_redis_instance().await; + let backend = super::RedisStorage::new(redis_instance.uri().to_string()).await.unwrap(); test_backend_get_channel_list(backend).await; - redis.kill().expect("Redis wasn't running"); - drop(tempdir); } } |