🐛 bug: fix tests not compiling
parent
8a04481236
commit
13c1ddc01a
|
@ -290,10 +290,10 @@ mod tests {
|
||||||
dev_mode: Default::default (),
|
dev_mode: Default::default (),
|
||||||
},
|
},
|
||||||
port: Some (4000),
|
port: Some (4000),
|
||||||
servers: vec! [],
|
servers: Some (vec! []),
|
||||||
scraper_keys: vec! [
|
scraper_keys: Some (vec! [
|
||||||
self.valid_key.map (|x| key_validity::ScraperKey::new_30_day ("automated test", x.as_bytes ())),
|
self.valid_key.map (|x| key_validity::ScraperKey::new_30_day ("automated test", x.as_bytes ())),
|
||||||
].into_iter ().filter_map (|x| x).collect (),
|
].into_iter ().filter_map (|x| x).collect ()),
|
||||||
};
|
};
|
||||||
|
|
||||||
let config = config::Config::try_from (config_file).expect ("Can't load config");
|
let config = config::Config::try_from (config_file).expect ("Can't load config");
|
||||||
|
|
|
@ -34,14 +34,14 @@ async fn main () -> anyhow::Result <()> {
|
||||||
let config_file = ptth_relay::config::file::Config {
|
let config_file = ptth_relay::config::file::Config {
|
||||||
iso: Default::default (),
|
iso: Default::default (),
|
||||||
port: Some (relay_port),
|
port: Some (relay_port),
|
||||||
servers: vec! [
|
servers: Some (vec! [
|
||||||
ptth_relay::config::file::Server {
|
ptth_relay::config::file::Server {
|
||||||
name: server_name.to_string (),
|
name: server_name.to_string (),
|
||||||
tripcode,
|
tripcode,
|
||||||
display_name: None,
|
display_name: None,
|
||||||
},
|
},
|
||||||
],
|
]),
|
||||||
scraper_keys: vec! [],
|
scraper_keys: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let config = ptth_relay::config::Config::try_from (config_file).expect ("Can't load config");
|
let config = ptth_relay::config::Config::try_from (config_file).expect ("Can't load config");
|
||||||
|
|
12
src/tests.rs
12
src/tests.rs
|
@ -102,14 +102,14 @@ impl TestingRelay {
|
||||||
let config_file = config::file::Config {
|
let config_file = config::file::Config {
|
||||||
iso: Default::default (),
|
iso: Default::default (),
|
||||||
port: Some (testing_config.relay_port),
|
port: Some (testing_config.relay_port),
|
||||||
servers: vec! [
|
servers: Some (vec! [
|
||||||
config::file::Server {
|
config::file::Server {
|
||||||
name: testing_config.server_name.to_string (),
|
name: testing_config.server_name.to_string (),
|
||||||
tripcode,
|
tripcode,
|
||||||
display_name: None,
|
display_name: None,
|
||||||
},
|
},
|
||||||
],
|
]),
|
||||||
scraper_keys: vec! [],
|
scraper_keys: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let cfg = config::Config::try_from (config_file).expect ("Can't load config");
|
let cfg = config::Config::try_from (config_file).expect ("Can't load config");
|
||||||
|
@ -279,10 +279,10 @@ async fn scraper_endpoints () {
|
||||||
dev_mode: Default::default (),
|
dev_mode: Default::default (),
|
||||||
},
|
},
|
||||||
port: Some (4001),
|
port: Some (4001),
|
||||||
servers: vec! [],
|
servers: None,
|
||||||
scraper_keys: vec! [
|
scraper_keys: Some (vec! [
|
||||||
key_validity::ScraperKey::new_30_day ("automated testing", b"bogus")
|
key_validity::ScraperKey::new_30_day ("automated testing", b"bogus")
|
||||||
],
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
let config = config::Config::try_from (config_file).expect ("Can't load config");
|
let config = config::Config::try_from (config_file).expect ("Can't load config");
|
||||||
|
|
Loading…
Reference in New Issue