Updated tests

This commit is contained in:
arkpar 2016-12-12 17:53:17 +01:00
parent edb853ca35
commit 85fd62917a
3 changed files with 14 additions and 7 deletions

View File

@ -669,7 +669,7 @@ mod tests {
// -- Miscellaneous Options // -- Miscellaneous Options
flag_version: false, flag_version: false,
flag_config: "$HOME/.parity/config.toml".into(), flag_config: "$DATA/config.toml".into(),
flag_logging: Some("own_tx=trace".into()), flag_logging: Some("own_tx=trace".into()),
flag_log_file: Some("/var/log/parity.log".into()), flag_log_file: Some("/var/log/parity.log".into()),
flag_no_color: false, flag_no_color: false,

View File

@ -744,7 +744,8 @@ mod tests {
use signer::{Configuration as SignerConfiguration}; use signer::{Configuration as SignerConfiguration};
use blockchain::{BlockchainCmd, ImportBlockchain, ExportBlockchain, DataFormat, ExportState}; use blockchain::{BlockchainCmd, ImportBlockchain, ExportBlockchain, DataFormat, ExportState};
use presale::ImportWallet; use presale::ImportWallet;
use account::{AccountCmd, NewAccount, ImportAccounts}; use params::SpecType;
use account::{AccountCmd, NewAccount, ImportAccounts, ListAccounts};
use devtools::{RandomTempPath}; use devtools::{RandomTempPath};
use std::io::Write; use std::io::Write;
use std::fs::{File, create_dir}; use std::fs::{File, create_dir};
@ -773,6 +774,7 @@ mod tests {
iterations: 10240, iterations: 10240,
path: replace_home("", "$HOME/.parity/keys"), path: replace_home("", "$HOME/.parity/keys"),
password_file: None, password_file: None,
spec: SpecType::default(),
}))); })));
} }
@ -781,7 +783,10 @@ mod tests {
let args = vec!["parity", "account", "list"]; let args = vec!["parity", "account", "list"];
let conf = parse(&args); let conf = parse(&args);
assert_eq!(conf.into_command().unwrap().cmd, Cmd::Account( assert_eq!(conf.into_command().unwrap().cmd, Cmd::Account(
AccountCmd::List(replace_home("", "$HOME/.parity/keys")), AccountCmd::List(ListAccounts {
path: replace_home("", "$HOME/.parity/keys"),
spec: SpecType::default(),
})
)); ));
} }
@ -792,6 +797,7 @@ mod tests {
assert_eq!(conf.into_command().unwrap().cmd, Cmd::Account(AccountCmd::Import(ImportAccounts { assert_eq!(conf.into_command().unwrap().cmd, Cmd::Account(AccountCmd::Import(ImportAccounts {
from: vec!["my_dir".into(), "another_dir".into()], from: vec!["my_dir".into(), "another_dir".into()],
to: replace_home("", "$HOME/.parity/keys"), to: replace_home("", "$HOME/.parity/keys"),
spec: SpecType::default(),
}))); })));
} }
@ -804,6 +810,7 @@ mod tests {
path: replace_home("", "$HOME/.parity/keys"), path: replace_home("", "$HOME/.parity/keys"),
wallet_path: "my_wallet.json".into(), wallet_path: "my_wallet.json".into(),
password_file: Some("pwd".into()), password_file: Some("pwd".into()),
spec: SpecType::default(),
})); }));
} }

View File

@ -196,10 +196,10 @@ mod tests {
#[test] #[test]
fn test_default_directories() { fn test_default_directories() {
let expected = Directories { let expected = Directories {
db: replace_home("$HOME/.parity"), data: replace_home("", "$HOME/.parity"),
keys: replace_home("$HOME/.parity/keys"), keys: replace_home("", "$HOME/.parity/keys"),
signer: replace_home("$HOME/.parity/signer"), signer: replace_home("", "$HOME/.parity/signer"),
dapps: replace_home("$HOME/.parity/dapps"), dapps: replace_home("", "$HOME/.parity/dapps"),
}; };
assert_eq!(expected, Directories::default()); assert_eq!(expected, Directories::default());
} }