mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-02-01 18:20:17 +01:00
feat: added modules
This commit is contained in:
29
core/apps/server_test.go
Normal file
29
core/apps/server_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package apps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/imroc/req"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
_ = os.Setenv("CRAWLAB_DEMO", "false")
|
||||
}
|
||||
|
||||
func TestServer_Start(t *testing.T) {
|
||||
svr := GetServer()
|
||||
|
||||
// start
|
||||
go Start(svr)
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
res, err := req.Get(fmt.Sprintf("http://localhost:%s/system-info", viper.GetString("server.port")))
|
||||
require.Nil(t, err)
|
||||
resStr, err := res.ToString()
|
||||
require.Nil(t, err)
|
||||
require.Contains(t, resStr, "success")
|
||||
}
|
||||
Reference in New Issue
Block a user