2022-01-11 11:01:15 +02:00
|
|
|
package cnbutils_test
|
2021-09-14 16:14:50 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-01-11 11:01:15 +02:00
|
|
|
"github.com/SAP/jenkins-library/pkg/cnbutils"
|
2021-09-14 16:14:50 +02:00
|
|
|
"github.com/SAP/jenkins-library/pkg/mock"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBuildpackDownload(t *testing.T) {
|
2022-01-11 11:01:15 +02:00
|
|
|
var mockUtils = &cnbutils.MockUtils{
|
|
|
|
ExecMockRunner: &mock.ExecMockRunner{},
|
|
|
|
FilesMock: &mock.FilesMock{},
|
|
|
|
}
|
|
|
|
|
2022-03-30 13:58:16 +02:00
|
|
|
t.Run("it creates an order object", func(t *testing.T) {
|
|
|
|
order, err := cnbutils.DownloadBuildpacks("/destination", []string{"buildpack"}, "/tmp/config.json", mockUtils)
|
2021-09-14 16:14:50 +02:00
|
|
|
assert.NoError(t, err)
|
2022-03-30 13:58:16 +02:00
|
|
|
assert.Equal(t, 1, len(order.Order))
|
2021-09-14 16:14:50 +02:00
|
|
|
})
|
|
|
|
}
|