DashboardService: Consolidate constructors (#31886)

* DashboardService: Consolidate constructors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2021-03-12 11:51:02 +01:00
committed by GitHub
parent f917c2ab0f
commit 1716de88b5
8 changed files with 50 additions and 75 deletions
@@ -7,6 +7,8 @@ import (
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var (
@@ -23,18 +25,11 @@ func TestProvisionedSymlinkedFolder(t *testing.T) {
}
reader, err := NewDashboardFileReader(cfg, log.New("test-logger"))
if err != nil {
t.Error("expected err to be nil")
}
require.NoError(t, err)
want, err := filepath.Abs(containingID)
if err != nil {
t.Errorf("expected err to be nil")
}
require.NoError(t, err)
resolvedPath := reader.resolvedPath()
if resolvedPath != want {
t.Errorf("got %s want %s", resolvedPath, want)
}
assert.Equal(t, want, resolvedPath)
}