You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
488 B
17 lines
488 B
package log |
|
|
|
import ( |
|
"testing" |
|
"github.com/stretchr/testify/assert" |
|
) |
|
|
|
func TestBatchSendSwitch(t *testing.T) { |
|
agent := NewAgent(nil) |
|
assert.Equal(t, true, agent.batchSend) |
|
|
|
agent = NewAgent(&AgentConfig{TaskID: "000161", Proto: "unixpacket", Addr: "/var/run/lancer/collector_tcp.sock"}) |
|
assert.Equal(t, true, agent.batchSend) |
|
|
|
agent = NewAgent(&AgentConfig{TaskID: "000161", Proto: "unixgram", Addr: "/var/run/lancer/collector.sock"}) |
|
assert.Equal(t, false, agent.batchSend) |
|
}
|
|
|