komkom
7 years ago
1 changed files with 22 additions and 0 deletions
@ -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