0.3.0 unit tests: amon, datadog, librato

This commit is contained in:
Cameron Sparr
2016-01-07 10:09:04 -07:00
parent b9869eadc3
commit 0e398f5802
3 changed files with 30 additions and 20 deletions

View File

@@ -162,15 +162,16 @@ func TestBuildPoint(t *testing.T) {
},
}
for _, tt := range tagtests {
pt, err := buildPoint(tt.ptIn)
pt, err := buildPoints(tt.ptIn)
if err != nil && tt.err == nil {
t.Errorf("%s: unexpected error, %+v\n", tt.ptIn.Name(), err)
}
if tt.err != nil && err == nil {
t.Errorf("%s: expected an error (%s) but none returned", tt.ptIn.Name(), tt.err.Error())
}
if !reflect.DeepEqual(pt, tt.outPt) && tt.err == nil {
t.Errorf("%s: \nexpected %+v\ngot %+v\n", tt.ptIn.Name(), tt.outPt, pt)
if !reflect.DeepEqual(pt["value"], tt.outPt) && tt.err == nil {
t.Errorf("%s: \nexpected %+v\ngot %+v\n",
tt.ptIn.Name(), tt.outPt, pt["value"])
}
}
}