Do not rely on external server for amon unit tests

This commit is contained in:
Cameron Sparr 2015-12-11 13:09:09 -07:00
parent 16ce06f621
commit 4852b5c11e
1 changed files with 0 additions and 29 deletions

View File

@ -9,37 +9,8 @@ import (
"github.com/influxdb/telegraf/testutil"
"github.com/influxdb/influxdb/client/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var (
fakeServerKey = "123456"
fakeAmonInstance = "https://demo.amon.cx"
)
func TestUriOverride(t *testing.T) {
a := &Amon{
ServerKey: fakeServerKey,
AmonInstance: fakeAmonInstance,
}
err := a.Connect()
require.NoError(t, err)
err = a.Write(testutil.MockBatchPoints().Points())
require.NoError(t, err)
}
func TestAuthenticatedUrl(t *testing.T) {
a := &Amon{
ServerKey: fakeServerKey,
AmonInstance: fakeAmonInstance,
}
authUrl := a.authenticatedUrl()
assert.EqualValues(t, fmt.Sprintf("%s/api/system/%s", fakeAmonInstance, fakeServerKey), authUrl)
}
func TestBuildPoint(t *testing.T) {
var tagtests = []struct {
ptIn *client.Point