Skip to content

Commit

Permalink
internal/cli: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Oct 18, 2023
1 parent fa62a69 commit f1eb280
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/cli/server/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestFlagsWithoutConfig(t *testing.T) {

require.Equal(t, c.config.Identity, "")
require.Equal(t, c.config.DataDir, "./data")
require.Equal(t, c.config.KeyStoreDir, "")
require.Equal(t, c.config.Verbosity, 3)
require.Equal(t, c.config.RPCBatchLimit, uint64(0))
require.Equal(t, c.config.Snapshot, true)
Expand Down Expand Up @@ -74,6 +75,7 @@ func TestFlagsWithConfig(t *testing.T) {

require.Equal(t, c.config.Identity, "")
require.Equal(t, c.config.DataDir, "./data")
require.Equal(t, c.config.KeyStoreDir, "./keystore")
require.Equal(t, c.config.Verbosity, 3)
require.Equal(t, c.config.RPCBatchLimit, uint64(0))
require.Equal(t, c.config.Snapshot, true)
Expand Down Expand Up @@ -105,6 +107,7 @@ func TestFlagsWithConfigAndFlags(t *testing.T) {
"--config", "./testdata/test.toml",
"--identity", "Anon",
"--datadir", "",
"--keystore", "",
"--verbosity", "0",
"--rpc.batchlimit", "5",
"--snapshot=false",
Expand All @@ -128,6 +131,7 @@ func TestFlagsWithConfigAndFlags(t *testing.T) {

require.Equal(t, c.config.Identity, "Anon")
require.Equal(t, c.config.DataDir, "")
require.Equal(t, c.config.KeyStoreDir, "")
require.Equal(t, c.config.Verbosity, 0)
require.Equal(t, c.config.RPCBatchLimit, uint64(5))
require.Equal(t, c.config.Snapshot, false)
Expand Down
1 change: 1 addition & 0 deletions internal/cli/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ func DefaultConfig() *Config {
DataDir: DefaultDataDir(),
Ancient: "",
DBEngine: "leveldb",
KeyStoreDir: "",
Logging: &LoggingConfig{
Vmodule: "",
Json: false,
Expand Down
1 change: 1 addition & 0 deletions internal/cli/server/testdata/test.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
identity = ""
datadir = "./data"
keystore = "./keystore"
verbosity = 3
"rpc.batchlimit" = 0
snapshot = true
Expand Down

0 comments on commit f1eb280

Please sign in to comment.