a test added
This commit is contained in:
parent
0b1c5a07d0
commit
cbd8b1e36b
22
zabbix_test.go
Normal file
22
zabbix_test.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package zabbix
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
const (
|
||||||
|
hostname = `somehost.com`
|
||||||
|
zabbixhost = `172.30.30.30`
|
||||||
|
zabbixport = 1234
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestSend(t *testing.T) {
|
||||||
|
sender := NewSender(zabbixhost, zabbixport)
|
||||||
|
|
||||||
|
metrics := []*Metric{NewMetric(hostname, `key`, `value`)}
|
||||||
|
_, err := sender.Send(NewPacket(metrics))
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
t.Error("sending should have failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Logf("error: %v", err.Error())
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user