mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
24 lines
686 B
Go
24 lines
686 B
Go
package tempo
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestTempo(t *testing.T) {
|
|
plug, err := NewExecutor(&models.DataSource{})
|
|
executor := plug.(*tempoExecutor)
|
|
require.NoError(t, err)
|
|
|
|
t.Run("createRequest should set Auth header when basic auth is true ", func(t *testing.T) {
|
|
req, err := executor.createRequest(context.Background(), &models.DataSource{BasicAuth: true, BasicAuthUser: "john", BasicAuthPassword: "pass"}, "traceID")
|
|
require.NoError(t, err)
|
|
assert.Equal(t, 2, len(req.Header))
|
|
assert.NotEqual(t, req.Header.Get("Authorization"), "")
|
|
})
|
|
}
|