github.com/infraboard/keyauth@v0.8.1/conf/config_test.go (about)

     1  package conf_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/infraboard/keyauth/conf"
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func TestLoadConfigFromToml(t *testing.T) {
    11  	should := require.New(t)
    12  
    13  	err := conf.LoadConfigFromToml("../etc/keyauth.toml")
    14  	should.NoError(err)
    15  
    16  	t.Log(conf.C().Mongo.Endpoints)
    17  }
    18  
    19  func TestMongoClient(t *testing.T) {
    20  	should := require.New(t)
    21  
    22  	err := conf.LoadConfigFromToml("../etc/keyauth.toml")
    23  	should.NoError(err)
    24  
    25  	conf.C().Mongo.Client()
    26  }