Add test.
This commit is contained in:
parent
a44ef73b33
commit
24c6561bc1
@ -538,6 +538,9 @@ mod tests {
|
|||||||
use blockchain::{BlockchainCmd, ImportBlockchain, ExportBlockchain};
|
use blockchain::{BlockchainCmd, ImportBlockchain, ExportBlockchain};
|
||||||
use presale::ImportWallet;
|
use presale::ImportWallet;
|
||||||
use account::{AccountCmd, NewAccount, ImportAccounts};
|
use account::{AccountCmd, NewAccount, ImportAccounts};
|
||||||
|
use devtools::{RandomTempPath};
|
||||||
|
use std::io::Write;
|
||||||
|
use std::fs::{File, create_dir};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
struct TestPasswordReader(&'static str);
|
struct TestPasswordReader(&'static str);
|
||||||
@ -769,5 +772,16 @@ mod tests {
|
|||||||
// then
|
// then
|
||||||
assert_eq!(conf0.signer_enabled(), false);
|
assert_eq!(conf0.signer_enabled(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn should_not_bail_on_empty_line_in_reserved_peers() {
|
||||||
|
let temp = RandomTempPath::new();
|
||||||
|
create_dir(temp.as_str().to_owned()).unwrap();
|
||||||
|
let filename = temp.as_str().to_owned() + "/peers";
|
||||||
|
File::create(filename.clone()).unwrap().write_all(b" \n\t\n").unwrap();
|
||||||
|
let args = vec!["parity", "--reserved-peers", &filename];
|
||||||
|
let conf = Configuration::parse(args).unwrap();
|
||||||
|
assert!(conf.init_reserved_nodes().is_ok());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
extern crate docopt;
|
extern crate docopt;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_serialize;
|
||||||
|
extern crate ethcore_devtools as devtools;
|
||||||
|
#[macro_use]
|
||||||
extern crate ethcore_util as util;
|
extern crate ethcore_util as util;
|
||||||
extern crate ethcore;
|
extern crate ethcore;
|
||||||
extern crate ethsync;
|
extern crate ethsync;
|
||||||
|
Loading…
Reference in New Issue
Block a user