a test added

This commit is contained in:
komkom 2017-01-11 11:50:42 +01:00
parent 0b1c5a07d0
commit cbd8b1e36b

22
zabbix_test.go Normal file
View 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())
}