MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestNewManager

Function TestNewManager

internal/utils/agents/manager_test.go:13–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestNewManager(t *testing.T) {
14 if !testutils.IsSingleTesting() {
15 return
16 }
17
18 var db = agents.NewSQLiteDB(Tea.Root + "/data/agents.db")
19 err := db.Init()
20 if err != nil {
21 t.Fatal(err)
22 }
23
24 var manager = agents.NewManager()
25 manager.SetDB(db)
26 err = manager.Load()
27 if err != nil {
28 t.Fatal(err)
29 }
30
31 _, err = manager.Loop()
32 if err != nil {
33 t.Fatal(err)
34 }
35
36 t.Log(manager.LookupIP("192.168.3.100"))
37}

Callers

nothing calls this directly

Calls 9

IsSingleTestingFunction · 0.92
NewSQLiteDBFunction · 0.92
NewManagerFunction · 0.92
LogMethod · 0.80
LookupIPMethod · 0.80
InitMethod · 0.65
SetDBMethod · 0.65
LoadMethod · 0.45
LoopMethod · 0.45

Tested by

no test coverage detected