mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
24cb059a6b
* Rename DatasourceId path parameter * Implement fork ruler backendType() * Apply suggestions from code review
28 lines
569 B
Go
28 lines
569 B
Go
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestToMacaronPath(t *testing.T) {
|
|
testCases := []struct {
|
|
inputPath string
|
|
expectedOutputPath string
|
|
}{
|
|
{
|
|
inputPath: "",
|
|
expectedOutputPath: "",
|
|
},
|
|
{
|
|
inputPath: "/ruler/{Recipient}/api/v1/rules/{Namespace}/{Groupname}",
|
|
expectedOutputPath: "/ruler/:Recipient/api/v1/rules/:Namespace/:Groupname",
|
|
},
|
|
}
|
|
for _, tc := range testCases {
|
|
outputPath := toMacaronPath(tc.inputPath)
|
|
assert.Equal(t, tc.expectedOutputPath, outputPath)
|
|
}
|
|
}
|