Files
EdgeAPI/internal/db/models/node_value_dao_test.go

23 lines
469 B
Go
Raw Normal View History

2021-04-29 16:48:09 +08:00
package models
import (
2021-06-08 11:18:27 +08:00
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
2021-04-29 16:48:09 +08:00
_ "github.com/go-sql-driver/mysql"
_ "github.com/iwind/TeaGo/bootstrap"
"github.com/iwind/TeaGo/maps"
"testing"
"time"
)
func TestNodeValueDAO_CreateValue(t *testing.T) {
dao := NewNodeValueDAO()
m := maps.Map{
"hello": "world12344",
}
2021-06-08 11:18:27 +08:00
err := dao.CreateValue(nil, nodeconfigs.NodeRoleNode, 1, "test", m.AsJSON(), time.Now().Unix())
2021-04-29 16:48:09 +08:00
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}