forked from smartcontractkit/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
58 lines (49 loc) · 1.97 KB
/
main_test.go
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
48
49
50
51
52
53
54
55
56
57
58
// +build !windows
package main
import (
"io/ioutil"
"testing"
"github.com/smartcontractkit/chainlink/core/cmd"
"github.com/smartcontractkit/chainlink/core/internal/cltest"
)
func ExampleRun() {
t := &testing.T{}
tc, cleanup := cltest.NewConfig(t)
defer cleanup()
tc.Config.Set("CHAINLINK_DEV", false)
testClient := &cmd.Client{
Renderer: cmd.RendererTable{Writer: ioutil.Discard},
Config: tc.Config,
AppFactory: cmd.ChainlinkAppFactory{},
KeyStoreAuthenticator: cmd.TerminalKeyStoreAuthenticator{Prompter: &cltest.MockCountingPrompter{}},
FallbackAPIInitializer: &cltest.MockAPIInitializer{},
Runner: cmd.ChainlinkRunner{},
HTTP: cltest.NewMockAuthenticatedHTTPClient(tc.Config, "session"),
ChangePasswordPrompter: cltest.MockChangePasswordPrompter{},
}
Run(testClient, "core.test", "--help")
Run(testClient, "core.test", "--version")
// Output:
// NAME:
// core.test - CLI for Chainlink
// USAGE:
// core.test [global options] command [command options] [arguments...]
// VERSION:
// unset@unset
// COMMANDS:
// admin Commands for remotely taking admin related actions
// attempts, txas Commands for managing Ethereum Transaction Attempts
// bridges Commands for Bridges communicating with External Adapters
// config Commands for the node's configuration
// jobs Commands for managing Jobs
// keys Commands for managing various types of keys used by the Chainlink node
// node, local Commands for admin actions that must be run locally
// runs Commands for managing Runs
// txs Commands for handling Ethereum transactions
// help, h Shows a list of commands or help for one command
// GLOBAL OPTIONS:
// --json, -j json output as opposed to table
// --help, -h show help
// --version, -v print the version
// core.test version unset@unset
}