mirror of
https://github.com/grafana/grafana.git
synced 2025-01-16 19:52:33 -06:00
ed924b3d0c
* git the things: FS api internal changes * remove filestorage/service.go * remove filestore flag * remove dummy fs * readd fileblob import
37 lines
632 B
Go
37 lines
632 B
Go
package filestorage
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestFilestorageApi_Join(t *testing.T) {
|
|
var tests = []struct {
|
|
name string
|
|
parts []string
|
|
expected string
|
|
}{
|
|
{
|
|
name: "multiple parts",
|
|
parts: []string{"prefix", "p1", "p2"},
|
|
expected: "/prefix/p1/p2",
|
|
},
|
|
{
|
|
name: "no parts",
|
|
parts: []string{},
|
|
expected: "/",
|
|
},
|
|
{
|
|
name: "a single part",
|
|
parts: []string{"prefix"},
|
|
expected: "/prefix",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
require.Equal(t, tt.expected, Join(tt.parts...))
|
|
})
|
|
}
|
|
}
|