OSDN Git Service

add query
[bytom/bytom.git] / config / config_test.go
1 package config
2
3 import (
4         "testing"
5
6         "github.com/stretchr/testify/assert"
7 )
8
9 func TestDefaultConfig(t *testing.T) {
10         assert := assert.New(t)
11
12         // set up some defaults
13         cfg := DefaultConfig()
14         assert.NotNil(cfg.P2P)
15         assert.NotNil(cfg.Mempool)
16         assert.NotNil(cfg.Consensus)
17
18         // check the root dir stuff...
19         cfg.SetRoot("/foo")
20         cfg.Genesis = "bar"
21         cfg.DBPath = "/opt/data"
22         cfg.Mempool.WalPath = "wal/mem/"
23
24         assert.Equal("/foo/bar", cfg.GenesisFile())
25         assert.Equal("/opt/data", cfg.DBDir())
26         assert.Equal("/foo/wal/mem", cfg.Mempool.WalDir())
27
28 }