Documentation
¶
Index ¶
- type Interface
- func (mock *Interface) ErrorString(ret nvsandboxutils.Ret) string
- func (mock *Interface) ErrorStringCalls() []struct{ ... }
- func (mock *Interface) GetDriverVersion() (string, nvsandboxutils.Ret)
- func (mock *Interface) GetDriverVersionCalls() []struct{}
- func (mock *Interface) GetFileContent(s string) (string, nvsandboxutils.Ret)
- func (mock *Interface) GetFileContentCalls() []struct{ ... }
- func (mock *Interface) GetGpuResource(s string) ([]nvsandboxutils.GpuFileInfo, nvsandboxutils.Ret)
- func (mock *Interface) GetGpuResourceCalls() []struct{ ... }
- func (mock *Interface) Init(s string) nvsandboxutils.Ret
- func (mock *Interface) InitCalls() []struct{ ... }
- func (mock *Interface) LookupSymbol(s string) error
- func (mock *Interface) LookupSymbolCalls() []struct{ ... }
- func (mock *Interface) Shutdown() nvsandboxutils.Ret
- func (mock *Interface) ShutdownCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface struct {
// ErrorStringFunc mocks the ErrorString method.
ErrorStringFunc func(ret nvsandboxutils.Ret) string
// GetDriverVersionFunc mocks the GetDriverVersion method.
GetDriverVersionFunc func() (string, nvsandboxutils.Ret)
// GetFileContentFunc mocks the GetFileContent method.
GetFileContentFunc func(s string) (string, nvsandboxutils.Ret)
// GetGpuResourceFunc mocks the GetGpuResource method.
GetGpuResourceFunc func(s string) ([]nvsandboxutils.GpuFileInfo, nvsandboxutils.Ret)
// InitFunc mocks the Init method.
InitFunc func(s string) nvsandboxutils.Ret
// LookupSymbolFunc mocks the LookupSymbol method.
LookupSymbolFunc func(s string) error
// ShutdownFunc mocks the Shutdown method.
ShutdownFunc func() nvsandboxutils.Ret
// contains filtered or unexported fields
}
Interface is a mock implementation of nvsandboxutils.Interface.
func TestSomethingThatUsesInterface(t *testing.T) {
// make and configure a mocked nvsandboxutils.Interface
mockedInterface := &Interface{
ErrorStringFunc: func(ret nvsandboxutils.Ret) string {
panic("mock out the ErrorString method")
},
GetDriverVersionFunc: func() (string, nvsandboxutils.Ret) {
panic("mock out the GetDriverVersion method")
},
GetFileContentFunc: func(s string) (string, nvsandboxutils.Ret) {
panic("mock out the GetFileContent method")
},
GetGpuResourceFunc: func(s string) ([]nvsandboxutils.GpuFileInfo, nvsandboxutils.Ret) {
panic("mock out the GetGpuResource method")
},
InitFunc: func(s string) nvsandboxutils.Ret {
panic("mock out the Init method")
},
LookupSymbolFunc: func(s string) error {
panic("mock out the LookupSymbol method")
},
ShutdownFunc: func() nvsandboxutils.Ret {
panic("mock out the Shutdown method")
},
}
// use mockedInterface in code that requires nvsandboxutils.Interface
// and then make assertions.
}
func (*Interface) ErrorString ¶
func (mock *Interface) ErrorString(ret nvsandboxutils.Ret) string
ErrorString calls ErrorStringFunc.
func (*Interface) ErrorStringCalls ¶
func (mock *Interface) ErrorStringCalls() []struct { Ret nvsandboxutils.Ret }
ErrorStringCalls gets all the calls that were made to ErrorString. Check the length with:
len(mockedInterface.ErrorStringCalls())
func (*Interface) GetDriverVersion ¶
func (mock *Interface) GetDriverVersion() (string, nvsandboxutils.Ret)
GetDriverVersion calls GetDriverVersionFunc.
func (*Interface) GetDriverVersionCalls ¶
func (mock *Interface) GetDriverVersionCalls() []struct { }
GetDriverVersionCalls gets all the calls that were made to GetDriverVersion. Check the length with:
len(mockedInterface.GetDriverVersionCalls())
func (*Interface) GetFileContent ¶
func (mock *Interface) GetFileContent(s string) (string, nvsandboxutils.Ret)
GetFileContent calls GetFileContentFunc.
func (*Interface) GetFileContentCalls ¶
GetFileContentCalls gets all the calls that were made to GetFileContent. Check the length with:
len(mockedInterface.GetFileContentCalls())
func (*Interface) GetGpuResource ¶
func (mock *Interface) GetGpuResource(s string) ([]nvsandboxutils.GpuFileInfo, nvsandboxutils.Ret)
GetGpuResource calls GetGpuResourceFunc.
func (*Interface) GetGpuResourceCalls ¶
GetGpuResourceCalls gets all the calls that were made to GetGpuResource. Check the length with:
len(mockedInterface.GetGpuResourceCalls())
func (*Interface) Init ¶
func (mock *Interface) Init(s string) nvsandboxutils.Ret
Init calls InitFunc.
func (*Interface) InitCalls ¶
InitCalls gets all the calls that were made to Init. Check the length with:
len(mockedInterface.InitCalls())
func (*Interface) LookupSymbol ¶
LookupSymbol calls LookupSymbolFunc.
func (*Interface) LookupSymbolCalls ¶
LookupSymbolCalls gets all the calls that were made to LookupSymbol. Check the length with:
len(mockedInterface.LookupSymbolCalls())
func (*Interface) Shutdown ¶
func (mock *Interface) Shutdown() nvsandboxutils.Ret
Shutdown calls ShutdownFunc.
func (*Interface) ShutdownCalls ¶
func (mock *Interface) ShutdownCalls() []struct { }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedInterface.ShutdownCalls())