Exemplo n.º 1
0
func TestInfluxDBConfShouldDefaultEmpty(t *testing.T) {
	assert := assert.New(t)

	conf := influxdb.InfluxDBConf{}
	conf.Default()

	assert.Equal("localhost", conf.Host)
	assert.Equal(uint(8083), conf.Port)

}
Exemplo n.º 2
0
func TestInfluxDBConfShouldDefaultNonEmpty(t *testing.T) {
	assert := assert.New(t)

	conf := influxdb.InfluxDBConf{
		Port:     65536,
		Database: "morgoth",
	}
	conf.Default()

	assert.Equal("localhost", conf.Host)
	assert.Equal(uint(8083), conf.Port)
	assert.Equal("morgoth", conf.Database)

}
Exemplo n.º 3
0
func TestInfluxDBConfDefaultShouldIgnoreValidFields(t *testing.T) {
	assert := assert.New(t)

	conf := influxdb.InfluxDBConf{
		Host:     "influx",
		Port:     42,
		Database: "morgoth",
	}
	conf.Default()

	assert.Equal("influx", conf.Host)
	assert.Equal(uint(42), conf.Port)
	assert.Equal("morgoth", conf.Database)

}