mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-20 17:11:19 +02:00
36 lines
823 B
Rust
36 lines
823 B
Rust
use scootaloo::parse_toml;
|
|
|
|
#[test]
|
|
fn parse_good_toml() {
|
|
let tConfig = TwitterConfig {
|
|
username: "test",
|
|
consumer_key: "foo",
|
|
consumer_secret: "bar",
|
|
access_key: "secret",
|
|
access_secret: "super secret",
|
|
};
|
|
|
|
let mConfig = MastodonConfig {
|
|
base: "https://www.example.com",
|
|
client_id: "my_id",
|
|
client_secret: "this is secret",
|
|
redirect: "ooo:oooo:o",
|
|
token: "super secret",
|
|
};
|
|
|
|
let sConfig = ScootalooConfig {
|
|
db_path: "/tmp/scootaloo/scootaloo.db",
|
|
cache_path: "/tmp",
|
|
};
|
|
|
|
let test_config = Config {
|
|
twitter: tConfig,
|
|
mastodon: mConfig,
|
|
scootaloo: sConfig,
|
|
};
|
|
|
|
let parsed_config = parse_toml("tests/right_config.toml");
|
|
|
|
assert_eq!(parsed_config, test_config);
|
|
}
|