mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-20 17:11:19 +02:00
test: add rate_limit
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
use scootaloo::parse_toml;
|
use scootaloo::parse_toml;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_parse_good_toml_rate_limit() {
|
||||||
|
let parse_good_toml = parse_toml("tests/good_test_rate_limit.toml");
|
||||||
|
|
||||||
|
assert_eq!(parse_good_toml.scootaloo.rate_limit, Some(69 as usize));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_good_toml() {
|
fn test_parse_good_toml() {
|
||||||
let parse_good_toml = parse_toml("tests/good_test.toml");
|
let parse_good_toml = parse_toml("tests/good_test.toml");
|
||||||
@@ -9,6 +16,7 @@ fn test_parse_good_toml() {
|
|||||||
"/var/random/scootaloo.sqlite"
|
"/var/random/scootaloo.sqlite"
|
||||||
);
|
);
|
||||||
assert_eq!(parse_good_toml.scootaloo.cache_path, "/tmp/scootaloo");
|
assert_eq!(parse_good_toml.scootaloo.cache_path, "/tmp/scootaloo");
|
||||||
|
assert_eq!(parse_good_toml.scootaloo.rate_limit, None);
|
||||||
|
|
||||||
assert_eq!(parse_good_toml.twitter.consumer_key, "rand consumer key");
|
assert_eq!(parse_good_toml.twitter.consumer_key, "rand consumer key");
|
||||||
assert_eq!(parse_good_toml.twitter.consumer_secret, "secret");
|
assert_eq!(parse_good_toml.twitter.consumer_secret, "secret");
|
||||||
|
20
tests/good_test_rate_limit.toml
Normal file
20
tests/good_test_rate_limit.toml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[scootaloo]
|
||||||
|
|
||||||
|
db_path="/var/random/scootaloo.sqlite"
|
||||||
|
cache_path="/tmp/scootaloo"
|
||||||
|
rate_limit=69
|
||||||
|
|
||||||
|
[twitter]
|
||||||
|
consumer_key="rand consumer key"
|
||||||
|
consumer_secret="secret"
|
||||||
|
access_key="rand access key"
|
||||||
|
access_secret="super secret"
|
||||||
|
|
||||||
|
[mastodon]
|
||||||
|
[mastodon.tamerelol]
|
||||||
|
twitter_screen_name="tamerelol"
|
||||||
|
base = "https://m.nintendojo.fr"
|
||||||
|
client_id = "rand client id"
|
||||||
|
client_secret = "secret"
|
||||||
|
redirect = "urn:ietf:wg:oauth:2.0:oob"
|
||||||
|
token = "super secret"
|
Reference in New Issue
Block a user