basic test update
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
yc
2025-11-12 10:03:15 +01:00
parent f1444c8046
commit 66d228f143

View File

@@ -3,25 +3,25 @@ package test
import (
"net/http"
"net/http/httptest"
"testing"
"runtime"
"path/filepath"
_ "oc-discovery/routers"
"path/filepath"
"runtime"
"testing"
beego "github.com/beego/beego/v2/server/web"
"github.com/beego/beego/v2/core/logs"
beego "github.com/beego/beego/v2/server/web"
. "github.com/smartystreets/goconvey/convey"
)
func init() {
_, file, _, _ := runtime.Caller(0)
apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator))))
apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
beego.TestBeegoInit(apppath)
}
// TestGet is a sample to run an endpoint test
func TestGet(t *testing.T) {
r, _ := http.NewRequest("GET", "/v1/object", nil)
r, _ := http.NewRequest("GET", "/oc/version", nil)
w := httptest.NewRecorder()
beego.BeeApp.Handlers.ServeHTTP(w, r)
@@ -36,4 +36,3 @@ func TestGet(t *testing.T) {
})
})
}