1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00
portainer/pkg/edge/utils_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
562 B
Go
Raw Normal View History

package edge
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetPortainerURLFromEdgeKey(t *testing.T) {
tests := []struct {
name string
edgeKey string
expected string
}{
{
name: "ValidEdgeKey",
edgeKey: "aHR0cHM6Ly9wb3J0YWluZXIuaW98cG9ydGFpbmVyLmlvOjgwMDB8YXNkZnwx",
expected: "https://portainer.io",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result, err := GetPortainerURLFromEdgeKey(tt.edgeKey)
assert.NoError(t, err)
assert.Equal(t, tt.expected, result)
})
}
}