0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-06-02 18:29:40 +02:00
wp-ansible/plugin/util_test.go

29 lines
558 B
Go
Raw Normal View History

package plugin
import (
"testing"
2024-05-06 21:03:08 +02:00
"github.com/stretchr/testify/assert"
)
func TestPipInstall(t *testing.T) {
tests := []struct {
name string
requirements string
want []string
}{
{
name: "with valid requirements file",
requirements: "requirements.txt",
want: []string{pipBin, "install", "--upgrade", "--requirement", "requirements.txt"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := PipInstall(tt.requirements)
2024-05-06 21:03:08 +02:00
assert.Equal(t, tt.want, cmd.Cmd.Args)
})
}
}