mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 06:40:26 +08:00
33 lines
597 B
Go
33 lines
597 B
Go
package clients_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/TeaOSLab/EdgeAPI/internal/db/models/clients"
|
|
_ "github.com/go-sql-driver/mysql"
|
|
)
|
|
|
|
func TestClientSystemDAO_CreateSystemIfNotExists(t *testing.T) {
|
|
var dao = clients.NewClientSystemDAO()
|
|
{
|
|
err := dao.CreateSystemIfNotExists(nil, "Mac OS X")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
{
|
|
err := dao.CreateSystemIfNotExists(nil, "Mac OS X 2")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestClientSystemDAO_Clean(t *testing.T) {
|
|
var dao = clients.NewClientSystemDAO()
|
|
err := dao.Clean(nil, 30)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|