mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-05-15 09:06:39 +00:00
Regenerate mocks for formatting
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
bbb94be213
commit
2b5eeb8d24
@ -78,6 +78,7 @@ func (mock *DiscoverMock) Devices() ([]Device, error) {
|
||||
|
||||
// DevicesCalls gets all the calls that were made to Devices.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedDiscover.DevicesCalls())
|
||||
func (mock *DiscoverMock) DevicesCalls() []struct {
|
||||
} {
|
||||
@ -108,6 +109,7 @@ func (mock *DiscoverMock) Hooks() ([]Hook, error) {
|
||||
|
||||
// HooksCalls gets all the calls that were made to Hooks.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedDiscover.HooksCalls())
|
||||
func (mock *DiscoverMock) HooksCalls() []struct {
|
||||
} {
|
||||
@ -138,6 +140,7 @@ func (mock *DiscoverMock) Mounts() ([]Mount, error) {
|
||||
|
||||
// MountsCalls gets all the calls that were made to Mounts.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedDiscover.MountsCalls())
|
||||
func (mock *DiscoverMock) MountsCalls() []struct {
|
||||
} {
|
||||
|
@ -20,9 +20,6 @@ var _ Locator = &LocatorMock{}
|
||||
// LocateFunc: func(s string) ([]string, error) {
|
||||
// panic("mock out the Locate method")
|
||||
// },
|
||||
// RelativeFunc: func(s string) (string, error) {
|
||||
// panic("mock out the Relative method")
|
||||
// },
|
||||
// }
|
||||
//
|
||||
// // use mockedLocator in code that requires Locator
|
||||
@ -33,9 +30,6 @@ type LocatorMock struct {
|
||||
// LocateFunc mocks the Locate method.
|
||||
LocateFunc func(s string) ([]string, error)
|
||||
|
||||
// RelativeFunc mocks the Relative method.
|
||||
RelativeFunc func(s string) (string, error)
|
||||
|
||||
// calls tracks calls to the methods.
|
||||
calls struct {
|
||||
// Locate holds details about calls to the Locate method.
|
||||
@ -43,14 +37,8 @@ type LocatorMock struct {
|
||||
// S is the s argument value.
|
||||
S string
|
||||
}
|
||||
// Relative holds details about calls to the Relative method.
|
||||
Relative []struct {
|
||||
// S is the s argument value.
|
||||
S string
|
||||
}
|
||||
}
|
||||
lockLocate sync.RWMutex
|
||||
lockRelative sync.RWMutex
|
||||
}
|
||||
|
||||
// Locate calls LocateFunc.
|
||||
@ -75,6 +63,7 @@ func (mock *LocatorMock) Locate(s string) ([]string, error) {
|
||||
|
||||
// LocateCalls gets all the calls that were made to Locate.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedLocator.LocateCalls())
|
||||
func (mock *LocatorMock) LocateCalls() []struct {
|
||||
S string
|
||||
@ -87,38 +76,3 @@ func (mock *LocatorMock) LocateCalls() []struct {
|
||||
mock.lockLocate.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
||||
// Relative calls RelativeFunc.
|
||||
func (mock *LocatorMock) Relative(s string) (string, error) {
|
||||
callInfo := struct {
|
||||
S string
|
||||
}{
|
||||
S: s,
|
||||
}
|
||||
mock.lockRelative.Lock()
|
||||
mock.calls.Relative = append(mock.calls.Relative, callInfo)
|
||||
mock.lockRelative.Unlock()
|
||||
if mock.RelativeFunc == nil {
|
||||
var (
|
||||
sOut string
|
||||
errOut error
|
||||
)
|
||||
return sOut, errOut
|
||||
}
|
||||
return mock.RelativeFunc(s)
|
||||
}
|
||||
|
||||
// RelativeCalls gets all the calls that were made to Relative.
|
||||
// Check the length with:
|
||||
// len(mockedLocator.RelativeCalls())
|
||||
func (mock *LocatorMock) RelativeCalls() []struct {
|
||||
S string
|
||||
} {
|
||||
var calls []struct {
|
||||
S string
|
||||
}
|
||||
mock.lockRelative.RLock()
|
||||
calls = mock.calls.Relative
|
||||
mock.lockRelative.RUnlock()
|
||||
return calls
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ func (mock *RuntimeMock) Exec(strings []string) error {
|
||||
|
||||
// ExecCalls gets all the calls that were made to Exec.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedRuntime.ExecCalls())
|
||||
func (mock *RuntimeMock) ExecCalls() []struct {
|
||||
Strings []string
|
||||
|
@ -92,6 +92,7 @@ func (mock *SpecMock) Flush() error {
|
||||
|
||||
// FlushCalls gets all the calls that were made to Flush.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedSpec.FlushCalls())
|
||||
func (mock *SpecMock) FlushCalls() []struct {
|
||||
} {
|
||||
@ -122,6 +123,7 @@ func (mock *SpecMock) Load() (*specs.Spec, error) {
|
||||
|
||||
// LoadCalls gets all the calls that were made to Load.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedSpec.LoadCalls())
|
||||
func (mock *SpecMock) LoadCalls() []struct {
|
||||
} {
|
||||
@ -155,6 +157,7 @@ func (mock *SpecMock) LookupEnv(s string) (string, bool) {
|
||||
|
||||
// LookupEnvCalls gets all the calls that were made to LookupEnv.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedSpec.LookupEnvCalls())
|
||||
func (mock *SpecMock) LookupEnvCalls() []struct {
|
||||
S string
|
||||
@ -189,6 +192,7 @@ func (mock *SpecMock) Modify(specModifier SpecModifier) error {
|
||||
|
||||
// ModifyCalls gets all the calls that were made to Modify.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedSpec.ModifyCalls())
|
||||
func (mock *SpecMock) ModifyCalls() []struct {
|
||||
SpecModifier SpecModifier
|
||||
|
@ -67,6 +67,7 @@ func (mock *ConstraintMock) Assert() error {
|
||||
|
||||
// AssertCalls gets all the calls that were made to Assert.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedConstraint.AssertCalls())
|
||||
func (mock *ConstraintMock) AssertCalls() []struct {
|
||||
} {
|
||||
@ -96,6 +97,7 @@ func (mock *ConstraintMock) String() string {
|
||||
|
||||
// StringCalls gets all the calls that were made to String.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedConstraint.StringCalls())
|
||||
func (mock *ConstraintMock) StringCalls() []struct {
|
||||
} {
|
||||
|
@ -105,6 +105,7 @@ func (mock *PropertyMock) CompareTo(s string) (int, error) {
|
||||
|
||||
// CompareToCalls gets all the calls that were made to CompareTo.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedProperty.CompareToCalls())
|
||||
func (mock *PropertyMock) CompareToCalls() []struct {
|
||||
S string
|
||||
@ -136,6 +137,7 @@ func (mock *PropertyMock) Name() string {
|
||||
|
||||
// NameCalls gets all the calls that were made to Name.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedProperty.NameCalls())
|
||||
func (mock *PropertyMock) NameCalls() []struct {
|
||||
} {
|
||||
@ -165,6 +167,7 @@ func (mock *PropertyMock) String() string {
|
||||
|
||||
// StringCalls gets all the calls that were made to String.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedProperty.StringCalls())
|
||||
func (mock *PropertyMock) StringCalls() []struct {
|
||||
} {
|
||||
@ -197,6 +200,7 @@ func (mock *PropertyMock) Validate(s string) error {
|
||||
|
||||
// ValidateCalls gets all the calls that were made to Validate.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedProperty.ValidateCalls())
|
||||
func (mock *PropertyMock) ValidateCalls() []struct {
|
||||
S string
|
||||
@ -229,6 +233,7 @@ func (mock *PropertyMock) Value() (string, error) {
|
||||
|
||||
// ValueCalls gets all the calls that were made to Value.
|
||||
// Check the length with:
|
||||
//
|
||||
// len(mockedProperty.ValueCalls())
|
||||
func (mock *PropertyMock) ValueCalls() []struct {
|
||||
} {
|
||||
|
Loading…
Reference in New Issue
Block a user