mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
547ef5b55d
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
25 lines
632 B
Go
25 lines
632 B
Go
package cnbutils_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/SAP/jenkins-library/pkg/cnbutils"
|
|
"github.com/SAP/jenkins-library/pkg/mock"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestBuildpackDownload(t *testing.T) {
|
|
var mockUtils = &cnbutils.MockUtils{
|
|
ExecMockRunner: &mock.ExecMockRunner{},
|
|
FilesMock: &mock.FilesMock{},
|
|
}
|
|
|
|
t.Run("successfully downloads a buildpack", func(t *testing.T) {
|
|
mockUtils.AddDir("/tmp/testtest")
|
|
_, err := cnbutils.DownloadBuildpacks("/test", []string{"test"}, "/test/config.json", mockUtils)
|
|
|
|
assert.NoError(t, err)
|
|
assert.True(t, mockUtils.HasRemovedFile("/tmp/testtest"))
|
|
})
|
|
}
|