Files
grafana/pkg/services/provisioning/dashboards/file_reader_linux_test.go
T
Arve Knudsen 1716de88b5 DashboardService: Consolidate constructors (#31886)
* DashboardService: Consolidate constructors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-12 11:51:02 +01:00

36 lines
704 B
Go

// +build linux
package dashboards
import (
"path/filepath"
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var (
symlinkedFolder = "testdata/test-dashboards/symlink"
)
func TestProvisionedSymlinkedFolder(t *testing.T) {
cfg := &config{
Name: "Default",
Type: "file",
OrgID: 1,
Folder: "",
Options: map[string]interface{}{"path": symlinkedFolder},
}
reader, err := NewDashboardFileReader(cfg, log.New("test-logger"))
require.NoError(t, err)
want, err := filepath.Abs(containingID)
require.NoError(t, err)
resolvedPath := reader.resolvedPath()
assert.Equal(t, want, resolvedPath)
}