MCPcopy Create free account
hub / github.com/chatmail/core / test_clear_config_cache

Function test_clear_config_cache

src/sql/migrations/migrations_tests.rs:13–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
13async fn test_clear_config_cache() -> anyhow::Result<()> {
14 // Some migrations change the `config` table in SQL.
15 // This test checks that the config cache is invalidated in `execute_migration()`.
16
17 let t = TestContext::new().await;
18 assert_eq!(t.get_config_bool(Config::IsChatmail).await?, false);
19
20 t.sql
21 .execute_migration(
22 "INSERT INTO config (keyname, value) VALUES ('is_chatmail', '1')",
23 1000,
24 )
25 .await?;
26 assert_eq!(t.get_config_bool(Config::IsChatmail).await?, true);
27 assert_eq!(t.sql.get_raw_config_int(VERSION_CFG).await?.unwrap(), 1000);
28
29 Ok(())
30}
31
32#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
33async fn test_key_contacts_migration_autocrypt() -> Result<()> {

Callers

nothing calls this directly

Calls 1

execute_migrationMethod · 0.80

Tested by

no test coverage detected