Fixed initial sync

This commit is contained in:
daladim 2021-04-04 00:35:59 +02:00
parent 842e34fb85
commit f2dd528d33
9 changed files with 233 additions and 62 deletions

View file

@ -1,9 +1,5 @@
mod scenarii;
use my_tasks::traits::CalDavSource;
use my_tasks::Provider;
use my_tasks::cache::Cache;
use my_tasks::calendar::cached_calendar::CachedCalendar;
@ -19,6 +15,8 @@ impl TestFlavour {
pub fn normal() -> Self { Self{} }
#[cfg(not(feature = "local_calendar_mocks_remote_calendars"))]
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(feature = "local_calendar_mocks_remote_calendars")]
pub fn normal() -> Self {
@ -34,6 +32,13 @@ impl TestFlavour {
}
}
#[cfg(feature = "local_calendar_mocks_remote_calendars")]
pub fn first_sync_to_server() -> Self {
Self {
scenarii: scenarii::scenarii_first_sync_to_server(),
}
}
#[cfg(not(feature = "local_calendar_mocks_remote_calendars"))]
pub async fn run(&self) {
@ -83,6 +88,22 @@ async fn test_sync_empty_initial_local() {
flavour.run().await;
}
#[tokio::test]
async fn test_sync_empty_initial_server() {
let _ = env_logger::builder().is_test(true).try_init();
let flavour = TestFlavour::first_sync_to_server();
flavour.run().await;
}
#[cfg(feature = "integration_tests")]
use my_tasks::{traits::CalDavSource,
Provider,
cache::Cache,
calendar::cached_calendar::CachedCalendar,
};
/// Print the contents of the provider. This is usually used for debugging
#[allow(dead_code)]
#[cfg(feature = "integration_tests")]