You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
553 B
Go
27 lines
553 B
Go
3 years ago
|
package commands
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/require"
|
||
|
)
|
||
|
|
||
|
func TestCsvToMap(t *testing.T) {
|
||
|
d := []string{
|
||
|
"\"tolerations=key=foo,value=bar;key=foo2,value=bar2\",replicas=1",
|
||
|
"namespace=default",
|
||
|
}
|
||
|
r, err := csvToMap(d)
|
||
|
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
require.Contains(t, r, "tolerations")
|
||
|
require.Equal(t, r["tolerations"], "key=foo,value=bar;key=foo2,value=bar2")
|
||
|
|
||
|
require.Contains(t, r, "replicas")
|
||
|
require.Equal(t, r["replicas"], "1")
|
||
|
|
||
|
require.Contains(t, r, "namespace")
|
||
|
require.Equal(t, r["namespace"], "default")
|
||
|
}
|