-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to the kubernetes options handling
Signed-off-by: Zsolt <[email protected]>
- Loading branch information
Zsolt
committed
Apr 12, 2022
1 parent
a9ab466
commit 071eee2
Showing
3 changed files
with
299 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
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") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.