[tests] Added transient task scenarii

This commit is contained in:
daladim 2021-04-05 22:21:56 +02:00
parent aa02fa182d
commit 9f7c2805ca
2 changed files with 83 additions and 10 deletions

View file

@ -17,6 +17,8 @@ impl TestFlavour {
pub fn first_sync_to_local() -> Self { Self{} }
#[cfg(not(feature = "local_calendar_mocks_remote_calendars"))]
pub fn first_sync_to_server() -> Self { Self{} }
#[cfg(not(feature = "local_calendar_mocks_remote_calendars"))]
pub fn transient_task() -> Self { Self{} }
#[cfg(feature = "local_calendar_mocks_remote_calendars")]
pub fn normal() -> Self {
@ -39,6 +41,13 @@ impl TestFlavour {
}
}
#[cfg(feature = "local_calendar_mocks_remote_calendars")]
pub fn transient_task() -> Self {
Self {
scenarii: scenarii::scenarii_transient_task(),
}
}
#[cfg(not(feature = "local_calendar_mocks_remote_calendars"))]
pub async fn run(&self) {
@ -96,6 +105,14 @@ async fn test_sync_empty_initial_server() {
flavour.run().await;
}
#[tokio::test]
async fn test_sync_transient_task() {
let _ = env_logger::builder().is_test(true).try_init();
let flavour = TestFlavour::transient_task();
flavour.run().await;
}
#[cfg(feature = "integration_tests")]
use my_tasks::{traits::CalDavSource,