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