chore: fix broken test from #2575

Thx @leovct: https://github.com/paradigmxyz/reth/pull/2575#issuecomment-1536726997
This commit is contained in:
Georgios Konstantopoulos
2023-05-05 18:27:30 -07:00
parent 10d0305b5e
commit bc5e150903

View File

@@ -798,14 +798,14 @@ mod tests {
#[test]
fn parse_db_path() {
let cmd = Command::try_parse_from(["reth", "--db", "my/path/to/db"]).unwrap();
let data_dir = cmd.datadir.unwrap_or_chain_default(cmd.chain.chain);
let db_path = data_dir.db_path();
assert_eq!(db_path, Path::new("my/path/to/db"));
let cmd = Command::try_parse_from(["reth"]).unwrap();
let data_dir = cmd.datadir.unwrap_or_chain_default(cmd.chain.chain);
let db_path = data_dir.db_path();
assert!(db_path.ends_with("reth/mainnet/db"), "{:?}", cmd.config);
let cmd = Command::try_parse_from(["reth", "--datadir", "my/custom/path"]).unwrap();
let data_dir = cmd.datadir.unwrap_or_chain_default(cmd.chain.chain);
let db_path = data_dir.db_path();
assert_eq!(db_path, Path::new("my/custom/path/db"));
}
}