forked from graphprotocol/graph-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.rs
More file actions
47 lines (44 loc) · 1.27 KB
/
Copy pathcli.rs
File metadata and controls
47 lines (44 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
extern crate assert_cli;
#[test]
fn node_fails_to_start_without_postgres_url() {
assert_cli::Assert::main_binary()
.fails()
.and()
.stderr()
.contains("error: The following required arguments were not provided:")
.unwrap();
}
#[test]
fn node_fails_to_start_with_unnamed_ethereum_network() {
assert_cli::Assert::main_binary()
.with_args(&[
"--postgres-url",
"postgresql://user:pass@localhost:5432/test",
"--ethereum-rpc",
"http://localhost:8545/",
"--ipfs",
"http://localhost:5001/",
])
.fails()
.and()
.stderr()
.contains("Failed to parse Ethereum networks: Is your Ethereum node string missing a network name? Try 'mainnet:' + the Ethereum node URL.")
.unwrap()
}
#[test]
fn node_fails_to_start_with_invalid_ipfs() {
assert_cli::Assert::main_binary()
.with_args(&[
"--postgres-url",
"postgresql://user:pass@localhost:5432/test",
"--ethereum-rpc",
"mainnet:http://localhost:8545/",
"--ipfs",
"http://my-node",
])
.fails()
.and()
.stderr()
.contains("Failed to connect to IPFS:")
.unwrap()
}