mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
18 lines
294 B
Go
18 lines
294 B
Go
package mongo
|
|
|
|
import (
|
|
"github.com/spf13/viper"
|
|
"github.com/stretchr/testify/require"
|
|
"testing"
|
|
)
|
|
|
|
func TestMongoGetDb(t *testing.T) {
|
|
dbName := "test_db"
|
|
viper.Set("mongo.db", dbName)
|
|
err := InitMongo()
|
|
require.Nil(t, err)
|
|
|
|
db := GetMongoDb("")
|
|
require.Equal(t, dbName, db.Name())
|
|
}
|