Example #1
0
func TestParseConsulEvents1(t *testing.T) {
	in := bytes.NewReader([]byte(ConsulInput1))
	ev, err := stretcher.ParseConsulEvents(in)
	if err != nil {
		t.Error(err)
	}
	if ev != nil {
		t.Error("Input1 must be empty!")
	}
}
Example #2
0
func TestParseConsulEvents2(t *testing.T) {
	in := bytes.NewReader([]byte(ConsulInput2))
	ev, err := stretcher.ParseConsulEvents(in)
	if err != nil {
		t.Error(err)
	}
	if ev.ID != "b5ef1588-1bcd-d93f-5d9c-67cb6e8c4587" {
		t.Error("invalid ID")
	}
	if ev.Name != "deploy" {
		t.Error("invalid Name")
	}
	if ev.PayloadString() != "s3://example.com/path/to/app.tar.gz" {
		t.Error("invalid PayloadString()", ev.PayloadString())
	}
}