mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-18 15:20:15 +01:00
Fix tests/redis.rs
This commit is contained in:
parent
80dcf6d49f
commit
d66ede5ecf
1 changed files with 16 additions and 14 deletions
|
@ -3,12 +3,9 @@ use std::{
|
||||||
future::Future,
|
future::Future,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
use teloxide::{
|
use teloxide::dispatching::dialogue::{
|
||||||
dispatching::dialogue::{
|
serializer::{Bincode, CBOR, JSON},
|
||||||
serializer::{Bincode, CBOR, JSON},
|
RedisStorage, Serializer, Storage,
|
||||||
RedisStorage, Serializer, Storage,
|
|
||||||
},
|
|
||||||
prelude::*,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
@ -40,28 +37,33 @@ where
|
||||||
check_dialogue(
|
check_dialogue(
|
||||||
None,
|
None,
|
||||||
Arc::clone(&storage).update_dialogue(11, "ABC".to_owned()),
|
Arc::clone(&storage).update_dialogue(11, "ABC".to_owned()),
|
||||||
);
|
)
|
||||||
|
.await;
|
||||||
check_dialogue(
|
check_dialogue(
|
||||||
None,
|
None,
|
||||||
Arc::clone(&storage).update_dialogue(256, "DEF".to_owned()),
|
Arc::clone(&storage).update_dialogue(256, "DEF".to_owned()),
|
||||||
);
|
)
|
||||||
|
.await;
|
||||||
check_dialogue(
|
check_dialogue(
|
||||||
None,
|
None,
|
||||||
Arc::clone(&storage).update_dialogue(11, "GHI".to_owned()),
|
Arc::clone(&storage).update_dialogue(11, "GHI".to_owned()),
|
||||||
);
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
check_dialogue(
|
check_dialogue(
|
||||||
"ABC",
|
"ABC",
|
||||||
Arc::clone(&storage).update_dialogue(1, "JKL".to_owned()),
|
Arc::clone(&storage).update_dialogue(1, "JKL".to_owned()),
|
||||||
);
|
)
|
||||||
|
.await;
|
||||||
check_dialogue(
|
check_dialogue(
|
||||||
"GHI",
|
"GHI",
|
||||||
Arc::clone(&storage).update_dialogue(11, "MNO".to_owned()),
|
Arc::clone(&storage).update_dialogue(11, "MNO".to_owned()),
|
||||||
);
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
check_dialogue("JKL", Arc::clone(&storage).remove_dialogue(1));
|
check_dialogue("JKL", Arc::clone(&storage).remove_dialogue(1)).await;
|
||||||
check_dialogue("DEF", Arc::clone(&storage).remove_dialogue(256));
|
check_dialogue("DEF", Arc::clone(&storage).remove_dialogue(256)).await;
|
||||||
check_dialogue("MNO", Arc::clone(&storage).remove_dialogue(11));
|
check_dialogue("MNO", Arc::clone(&storage).remove_dialogue(11)).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn check_dialogue<E>(
|
async fn check_dialogue<E>(
|
||||||
|
|
Loading…
Reference in a new issue