mirror of
https://github.com/thegeeklab/wp-ansible.git
synced 2024-11-21 23:50:40 +00:00
29 lines
558 B
Go
29 lines
558 B
Go
package plugin
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"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)
|
|
assert.Equal(t, tt.want, cmd.Cmd.Args)
|
|
})
|
|
}
|
|
}
|