github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/config/config_test.go (about) 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 16 // check the root dir stuff... 17 cfg.SetRoot("/foo") 18 cfg.DBPath = "/opt/data" 19 20 assert.Equal("/opt/data", cfg.DBDir()) 21 22 }