forked from target/impeller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin_test.go
44 lines (38 loc) · 997 Bytes
/
plugin_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/target/impeller/types"
)
func TestOverridesValueFiles(t *testing.T) {
p := &Plugin{
ValueFiles: []string{"test", "file"},
}
release := &types.Release{}
overrides := p.overrides(release)
require.Len(t, overrides, 2)
assert.Equal(t, "test", overrides[0].Value)
assert.False(t, overrides[0].ValueSecret)
assert.Equal(t, "file", overrides[1].Value)
assert.False(t, overrides[1].ValueSecret)
}
func TestOverridesIndividualOverrides(t *testing.T) {
override := "test"
p := &Plugin{}
release := &types.Release{
Overrides: []types.Override{
types.Override{
Target: "image.tag",
Value: types.Value{
Value: &override,
},
},
},
}
overrides := p.overrides(release)
require.Len(t, overrides, 1)
assert.Equal(t, "set", overrides[0].Name)
assert.Equal(t, "image.tag=test", overrides[0].Value)
assert.True(t, overrides[0].ValueSecret)
}