summaryrefslogtreecommitdiff
path: root/tests/shared.rs
blob: 2ea0bf58e2004a93ab136f7f2f32ece280c35314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use mesk::cfg::config::{Config, Repo, Log, Loglevel, Paths};

pub fn create_test_config(temp_dir_path: &str) -> Config {
    let cfg: Config =  Config {
            repo: Repo {
                repo_url: format!(r"http://mesk.anthrill.i2p/repo/{}", std::env::consts::ARCH),
                auto_update: true,
                destination: (String::from("mesk"), String::from("mesk")),
                repo_http_url: None,
            },
            log: Log {
                log_file: String::from("/var/log/mesk.log"),
                log_level: Loglevel::Info,
            },
            paths: Paths {
                cache_dir: String::from(temp_dir_path),
                build_dir: String::from(format!("{}/build", String::from(temp_dir_path)))
            },
        };
    
        cfg
}