mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 23:20:26 +08:00
42 lines
738 B
Go
42 lines
738 B
Go
package models
|
|
|
|
import (
|
|
_ "github.com/go-sql-driver/mysql"
|
|
"github.com/iwind/TeaGo/dbs"
|
|
"testing"
|
|
)
|
|
|
|
func TestHTTPWebDAO_UpdateWebShutdown(t *testing.T) {
|
|
{
|
|
err := SharedHTTPWebDAO.UpdateWebShutdown(1, []byte("{}"))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
{
|
|
err := SharedHTTPWebDAO.UpdateWebShutdown(1, nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
t.Log("ok")
|
|
}
|
|
|
|
func TestHTTPWebDAO_FindAllWebIdsWithHTTPFirewallPolicyId(t *testing.T) {
|
|
dbs.NotifyReady()
|
|
|
|
webIds, err := SharedHTTPWebDAO.FindAllWebIdsWithHTTPFirewallPolicyId(9)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log("webIds:", webIds)
|
|
|
|
count, err := SharedServerDAO.CountEnabledServersWithWebIds(webIds)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log("count:", count)
|
|
}
|