You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
550 B

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