mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-21 09:31:19 +02:00
feature(test): add tests
This commit is contained in:
35
config.rs
Normal file
35
config.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user