mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 16:29:18 +00:00
7627d48a5c
Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com> Signed-off-by: Evan Lezar <elezar@nvidia.com>
74 lines
1.6 KiB
Go
74 lines
1.6 KiB
Go
// Code generated by moq; DO NOT EDIT.
|
|
// github.com/matryer/moq
|
|
|
|
package nvcdi
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/NVIDIA/go-nvlib/pkg/nvml"
|
|
)
|
|
|
|
// Ensure, that nvmlUUIDerMock does implement nvmlUUIDer.
|
|
// If this is not the case, regenerate this file with moq.
|
|
var _ nvmlUUIDer = &nvmlUUIDerMock{}
|
|
|
|
// nvmlUUIDerMock is a mock implementation of nvmlUUIDer.
|
|
//
|
|
// func TestSomethingThatUsesnvmlUUIDer(t *testing.T) {
|
|
//
|
|
// // make and configure a mocked nvmlUUIDer
|
|
// mockednvmlUUIDer := &nvmlUUIDerMock{
|
|
// GetUUIDFunc: func() (string, nvml.Return) {
|
|
// panic("mock out the GetUUID method")
|
|
// },
|
|
// }
|
|
//
|
|
// // use mockednvmlUUIDer in code that requires nvmlUUIDer
|
|
// // and then make assertions.
|
|
//
|
|
// }
|
|
type nvmlUUIDerMock struct {
|
|
// GetUUIDFunc mocks the GetUUID method.
|
|
GetUUIDFunc func() (string, nvml.Return)
|
|
|
|
// calls tracks calls to the methods.
|
|
calls struct {
|
|
// GetUUID holds details about calls to the GetUUID method.
|
|
GetUUID []struct {
|
|
}
|
|
}
|
|
lockGetUUID sync.RWMutex
|
|
}
|
|
|
|
// GetUUID calls GetUUIDFunc.
|
|
func (mock *nvmlUUIDerMock) GetUUID() (string, nvml.Return) {
|
|
callInfo := struct {
|
|
}{}
|
|
mock.lockGetUUID.Lock()
|
|
mock.calls.GetUUID = append(mock.calls.GetUUID, callInfo)
|
|
mock.lockGetUUID.Unlock()
|
|
if mock.GetUUIDFunc == nil {
|
|
var (
|
|
sOut string
|
|
returnOut nvml.Return
|
|
)
|
|
return sOut, returnOut
|
|
}
|
|
return mock.GetUUIDFunc()
|
|
}
|
|
|
|
// GetUUIDCalls gets all the calls that were made to GetUUID.
|
|
// Check the length with:
|
|
//
|
|
// len(mockednvmlUUIDer.GetUUIDCalls())
|
|
func (mock *nvmlUUIDerMock) GetUUIDCalls() []struct {
|
|
} {
|
|
var calls []struct {
|
|
}
|
|
mock.lockGetUUID.RLock()
|
|
calls = mock.calls.GetUUID
|
|
mock.lockGetUUID.RUnlock()
|
|
return calls
|
|
}
|