use super::utils::CliTest;
#[test]
fn test_network_status() {
let cli = CliTest::new();
let output = cli.run(&["network", "status"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_network_nodes() {
let cli = CliTest::new();
let output = cli.run(&["network", "peers"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_network_switch() {
let cli = CliTest::new();
let testnet_output = cli.run(&["network", "connect", "--network", "testnet"]);
assert!(testnet_output.status.code().unwrap_or(127) != 127, "Command not found");
let status_output = cli.run(&["network", "status"]);
assert!(status_output.status.code().unwrap_or(127) != 127, "Command not found");
let mainnet_output = cli.run(&["network", "connect", "--network", "mainnet"]);
assert!(mainnet_output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_network_add_node() {
let cli = CliTest::new();
let output = cli.run(&[
"network",
"add",
"--url",
"http://seed1.ngd.network:10332",
"--name",
"test-node",
]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_network_set_default() {
let cli = CliTest::new();
cli.run(&[
"network",
"add",
"--url",
"http://seed2.ngd.network:10332",
"--name",
"default-node",
]);
let output = cli.run(&["network", "connect", "--network", "default-node"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}
#[test]
fn test_network_ping() {
let cli = CliTest::new();
let output = cli.run(&["network", "ping", "--network", "mainnet"]);
assert!(output.status.code().unwrap_or(127) != 127, "Command not found");
}