forked from p53841790/wheat-cache
feat(conf): updata conf test
This commit is contained in:
parent
4d9558c21f
commit
febd5501c4
|
@ -1,7 +1,6 @@
|
|||
package conf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
@ -26,18 +25,11 @@ func TestConf(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMiddleConf(t *testing.T) {
|
||||
ct := viper.GetStringMap("plugins-control")
|
||||
|
||||
fmt.Println(ct)
|
||||
ct := viper.GetStringSlice("plugins-control.logcontext")
|
||||
require.Equal(t, ct, []string{"logMiddle"})
|
||||
|
||||
d := viper.GetInt("middleware-driver.driverCount")
|
||||
require.Equal(t, d, 1000)
|
||||
c := viper.GetInt("middleware-driver.middleConsumerCount")
|
||||
require.Equal(t, c, 5)
|
||||
|
||||
p := viper.GetStringMap("plugins-control")
|
||||
for key, val := range p {
|
||||
fmt.Println(key, val)
|
||||
}
|
||||
// fmt.Println(p)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue