fix tests

This commit is contained in:
Megan Marsh 2020-10-23 15:35:37 -07:00
parent 19bd997f11
commit 7646ecf8c6
2 changed files with 9 additions and 1 deletions

View File

@ -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")

View File

@ -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 == "" {