2022-01-13 17:36:41 +00:00
|
|
|
use crate::ctx::Context;
|
|
|
|
use crate::dbs::Options;
|
2022-02-15 01:00:30 +00:00
|
|
|
use crate::dbs::Transaction;
|
2022-05-03 20:20:36 +00:00
|
|
|
use crate::kvs::Datastore;
|
2022-02-15 01:00:30 +00:00
|
|
|
use futures::lock::Mutex;
|
|
|
|
use std::sync::Arc;
|
2022-01-13 17:36:41 +00:00
|
|
|
|
2022-05-14 12:35:08 +00:00
|
|
|
pub async fn mock<'a>() -> (Context<'a>, Options, Transaction) {
|
|
|
|
let ctx = Context::default();
|
2022-01-13 17:36:41 +00:00
|
|
|
let opt = Options::default();
|
2022-05-03 20:20:36 +00:00
|
|
|
let kvs = Datastore::new("memory").await.unwrap();
|
|
|
|
let txn = kvs.transaction(true, false).await.unwrap();
|
|
|
|
let txn = Arc::new(Mutex::new(txn));
|
2022-02-15 01:00:30 +00:00
|
|
|
(ctx, opt, txn)
|
2022-01-13 17:36:41 +00:00
|
|
|
}
|