Removed tests relating to timeinms
@@ -16,13 +16,11 @@ var (
"gauge": false,
"count": false,
"timing": false,
- "timeinms": false,
}
calledFunctions = map[string]bool{
"gauge": false,
"count": false,
"timing": false,
- "timeinms": false,
}
badCall = false
)
@@ -52,13 +50,6 @@ func (c *fakeClient) Timing(name string, value time.Duration, tags []string, rat
}
return nil
}
-func (c *fakeClient) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error {
- calledFunctions["timeinms"] = true
- if badCall {
- return errors.New("error sending metric")
- }
- return nil
-}
func TestMain(m *testing.M) {
logrus.SetLevel(logrus.WarnLevel) // turns off logging in veneur-emit
@@ -98,17 +89,6 @@ func TestTiming(t *testing.T) {
}
}
-func TestTimeInMilliseconds(t *testing.T) {
- client := &fakeClient{}
- resetMap(testFlag)
- resetMap(calledFunctions)
- testFlag["timeinms"] = true
- err := sendMetrics(client, testFlag, "testMetric", testTags)
- if err != nil || !calledFunctions["timeinms"] {
- t.Error("Did not send 'timeinms' metric.")
- }
-}
-
func TestMultiple(t *testing.T) {
client := &fakeClient{}
resetMap(testFlag)
@@ -152,14 +132,6 @@ func TestBadCalls(t *testing.T) {
t.Error("Did not detect error")
}
- resetMap(testFlag)
- resetMap(calledFunctions)
- testFlag["timeinms"] = true
- err = sendMetrics(client, testFlag, "testBadMetric", testTags)
- if err == nil || err.Error() != "error sending metric" || !calledFunctions["timeinms"] {
- t.Error("Did not detect error")
- }
-
resetMap(testFlag)
resetMap(calledFunctions)
testFlag["count"] = true
@@ -179,26 +151,6 @@ func TestHostport(t *testing.T) {
}
}
-func TestInvalidHostport(t *testing.T) {
- resetMap(testFlag)
- testFlag["hostport"] = true
- testHostport := "hostport"
- addr, err := addr(testFlag, nil, &testHostport)
- if addr != "" || err == nil {
- t.Error("Did not check for valid hostport flag.")
- }
-}
-
-func TestEmptyHostport(t *testing.T) {
- resetMap(testFlag)
- testFlag["hostport"] = true
- testHostport := ""
- addr, err := addr(testFlag, nil, &testHostport)
- if addr != "" || err == nil {
- t.Error("Did not check for valid hostport.")
- }
-}
-
func TestNilHostport(t *testing.T) {
resetMap(testFlag)
testFlag["hostport"] = true
