fix tests
This commit is contained in:
parent
19bd997f11
commit
7646ecf8c6
|
@ -11,7 +11,11 @@ import (
|
||||||
|
|
||||||
func TestStepRemoteUpload_Run(t *testing.T) {
|
func TestStepRemoteUpload_Run(t *testing.T) {
|
||||||
state := basicStateBag(nil)
|
state := basicStateBag(nil)
|
||||||
|
dsMock := driver.DatastoreMock{
|
||||||
|
DirExistsReturn: false,
|
||||||
|
}
|
||||||
driverMock := driver.NewDriverMock()
|
driverMock := driver.NewDriverMock()
|
||||||
|
driverMock.DatastoreMock = &dsMock
|
||||||
state.Put("driver", driverMock)
|
state.Put("driver", driverMock)
|
||||||
state.Put("iso_path", "[datastore] iso/path")
|
state.Put("iso_path", "[datastore] iso/path")
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ type DatastoreMock struct {
|
||||||
FileExistsCalled bool
|
FileExistsCalled bool
|
||||||
FileExistsReturn bool
|
FileExistsReturn bool
|
||||||
|
|
||||||
|
DirExistsCalled bool
|
||||||
|
DirExistsReturn bool
|
||||||
|
|
||||||
NameReturn string
|
NameReturn string
|
||||||
|
|
||||||
MakeDirectoryCalled bool
|
MakeDirectoryCalled bool
|
||||||
|
@ -38,7 +41,8 @@ func (ds *DatastoreMock) FileExists(path string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ds *DatastoreMock) DirExists(path string) bool {
|
func (ds *DatastoreMock) DirExists(path string) bool {
|
||||||
return true
|
ds.DirExistsCalled = true
|
||||||
|
return ds.DirExistsReturn
|
||||||
}
|
}
|
||||||
func (ds *DatastoreMock) Name() string {
|
func (ds *DatastoreMock) Name() string {
|
||||||
if ds.NameReturn == "" {
|
if ds.NameReturn == "" {
|
||||||
|
|
Loading…
Reference in New Issue