@@ -2,16 +2,15 @@ package conda_test
22
33import (
44 "bytes"
5- io "io"
6- "io/ioutil"
5+ "io"
76 "os"
87 "path/filepath"
98
109 "github.com/cloudfoundry/python-buildpack/src/python/conda"
1110
1211 "github.com/cloudfoundry/libbuildpack"
1312 "github.com/cloudfoundry/libbuildpack/ansicleaner"
14- gomock "github.com/golang/mock/gomock"
13+ "github.com/golang/mock/gomock"
1514 . "github.com/onsi/ginkgo"
1615 . "github.com/onsi/gomega"
1716)
@@ -36,11 +35,11 @@ var _ = Describe("Conda", func() {
3635 )
3736
3837 BeforeEach (func () {
39- buildDir , err = ioutil . TempDir ("" , "python-buildpack.build." )
38+ buildDir , err = os . MkdirTemp ("" , "python-buildpack.build." )
4039 Expect (err ).To (BeNil ())
41- cacheDir , err = ioutil . TempDir ("" , "python-buildpack.cache." )
40+ cacheDir , err = os . MkdirTemp ("" , "python-buildpack.cache." )
4241 Expect (err ).To (BeNil ())
43- depsDir , err = ioutil . TempDir ("" , "python-buildpack.deps." )
42+ depsDir , err = os . MkdirTemp ("" , "python-buildpack.deps." )
4443 Expect (err ).To (BeNil ())
4544 depsIdx = "13"
4645 depDir = filepath .Join (depsDir , depsIdx )
@@ -70,7 +69,7 @@ var _ = Describe("Conda", func() {
7069 Describe ("Version" , func () {
7170 Context ("runtime.txt specifies python 3" , func () {
7271 BeforeEach (func () {
73- Expect (ioutil .WriteFile (filepath .Join (buildDir , "runtime.txt" ), []byte ("python-3.2.3" ), 0644 )).To (Succeed ())
72+ Expect (os .WriteFile (filepath .Join (buildDir , "runtime.txt" ), []byte ("python-3.2.3" ), 0644 )).To (Succeed ())
7473 })
7574
7675 It ("returns 'miniconda3-py39'" , func () {
@@ -88,7 +87,7 @@ var _ = Describe("Conda", func() {
8887 Describe ("Install" , func () {
8988 It ("downloads and installs miniconda version" , func () {
9089 mockInstaller .EXPECT ().InstallOnlyVersion ("Miniconda7" , gomock .Any ()).Do (func (_ , path string ) {
91- Expect (ioutil .WriteFile (path , []byte {}, 0644 )).To (Succeed ())
90+ Expect (os .WriteFile (path , []byte {}, 0644 )).To (Succeed ())
9291 })
9392 mockCommand .EXPECT ().Execute ("/" , gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ())
9493
@@ -97,7 +96,7 @@ var _ = Describe("Conda", func() {
9796
9897 It ("make downloaded file executable" , func () {
9998 mockInstaller .EXPECT ().InstallOnlyVersion ("Miniconda7" , gomock .Any ()).Do (func (_ , path string ) {
100- Expect (ioutil .WriteFile (path , []byte {}, 0644 )).To (Succeed ())
99+ Expect (os .WriteFile (path , []byte {}, 0644 )).To (Succeed ())
101100 })
102101 mockCommand .EXPECT ().Execute ("/" , gomock .Any (), gomock .Any (), gomock .Any (), "-b" , "-p" , filepath .Join (depDir , "conda" )).Do (func (_ string , _ , _ io.Writer , path string , _ ... string ) {
103102 fi , err := os .Lstat (path )
@@ -111,7 +110,7 @@ var _ = Describe("Conda", func() {
111110 It ("deletes installer" , func () {
112111 var installerPath string
113112 mockInstaller .EXPECT ().InstallOnlyVersion ("Miniconda7" , gomock .Any ()).Do (func (_ , path string ) {
114- Expect (ioutil .WriteFile (path , []byte {}, 0644 )).To (Succeed ())
113+ Expect (os .WriteFile (path , []byte {}, 0644 )).To (Succeed ())
115114 installerPath = path
116115 })
117116 mockCommand .EXPECT ().Execute ("/" , gomock .Any (), gomock .Any (), gomock .Any (), "-b" , "-p" , filepath .Join (depDir , "conda" )).Do (func (_ string , _ , _ io.Writer , path string , _ ... string ) {
0 commit comments