mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +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.
|
// DevicesCalls gets all the calls that were made to Devices.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedDiscover.DevicesCalls())
|
// len(mockedDiscover.DevicesCalls())
|
||||||
func (mock *DiscoverMock) DevicesCalls() []struct {
|
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.
|
// HooksCalls gets all the calls that were made to Hooks.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedDiscover.HooksCalls())
|
// len(mockedDiscover.HooksCalls())
|
||||||
func (mock *DiscoverMock) HooksCalls() []struct {
|
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.
|
// MountsCalls gets all the calls that were made to Mounts.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedDiscover.MountsCalls())
|
// len(mockedDiscover.MountsCalls())
|
||||||
func (mock *DiscoverMock) MountsCalls() []struct {
|
func (mock *DiscoverMock) MountsCalls() []struct {
|
||||||
} {
|
} {
|
||||||
|
@ -20,9 +20,6 @@ var _ Locator = &LocatorMock{}
|
|||||||
// LocateFunc: func(s string) ([]string, error) {
|
// LocateFunc: func(s string) ([]string, error) {
|
||||||
// panic("mock out the Locate method")
|
// 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
|
// // use mockedLocator in code that requires Locator
|
||||||
@ -33,9 +30,6 @@ type LocatorMock struct {
|
|||||||
// LocateFunc mocks the Locate method.
|
// LocateFunc mocks the Locate method.
|
||||||
LocateFunc func(s string) ([]string, error)
|
LocateFunc func(s string) ([]string, error)
|
||||||
|
|
||||||
// RelativeFunc mocks the Relative method.
|
|
||||||
RelativeFunc func(s string) (string, error)
|
|
||||||
|
|
||||||
// calls tracks calls to the methods.
|
// calls tracks calls to the methods.
|
||||||
calls struct {
|
calls struct {
|
||||||
// Locate holds details about calls to the Locate method.
|
// Locate holds details about calls to the Locate method.
|
||||||
@ -43,14 +37,8 @@ type LocatorMock struct {
|
|||||||
// S is the s argument value.
|
// S is the s argument value.
|
||||||
S string
|
S string
|
||||||
}
|
}
|
||||||
// Relative holds details about calls to the Relative method.
|
|
||||||
Relative []struct {
|
|
||||||
// S is the s argument value.
|
|
||||||
S string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
lockLocate sync.RWMutex
|
lockLocate sync.RWMutex
|
||||||
lockRelative sync.RWMutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Locate calls LocateFunc.
|
// 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.
|
// LocateCalls gets all the calls that were made to Locate.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedLocator.LocateCalls())
|
// len(mockedLocator.LocateCalls())
|
||||||
func (mock *LocatorMock) LocateCalls() []struct {
|
func (mock *LocatorMock) LocateCalls() []struct {
|
||||||
S string
|
S string
|
||||||
@ -87,38 +76,3 @@ func (mock *LocatorMock) LocateCalls() []struct {
|
|||||||
mock.lockLocate.RUnlock()
|
mock.lockLocate.RUnlock()
|
||||||
return calls
|
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.
|
// ExecCalls gets all the calls that were made to Exec.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedRuntime.ExecCalls())
|
// len(mockedRuntime.ExecCalls())
|
||||||
func (mock *RuntimeMock) ExecCalls() []struct {
|
func (mock *RuntimeMock) ExecCalls() []struct {
|
||||||
Strings []string
|
Strings []string
|
||||||
|
@ -92,6 +92,7 @@ func (mock *SpecMock) Flush() error {
|
|||||||
|
|
||||||
// FlushCalls gets all the calls that were made to Flush.
|
// FlushCalls gets all the calls that were made to Flush.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedSpec.FlushCalls())
|
// len(mockedSpec.FlushCalls())
|
||||||
func (mock *SpecMock) FlushCalls() []struct {
|
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.
|
// LoadCalls gets all the calls that were made to Load.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedSpec.LoadCalls())
|
// len(mockedSpec.LoadCalls())
|
||||||
func (mock *SpecMock) LoadCalls() []struct {
|
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.
|
// LookupEnvCalls gets all the calls that were made to LookupEnv.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedSpec.LookupEnvCalls())
|
// len(mockedSpec.LookupEnvCalls())
|
||||||
func (mock *SpecMock) LookupEnvCalls() []struct {
|
func (mock *SpecMock) LookupEnvCalls() []struct {
|
||||||
S string
|
S string
|
||||||
@ -189,6 +192,7 @@ func (mock *SpecMock) Modify(specModifier SpecModifier) error {
|
|||||||
|
|
||||||
// ModifyCalls gets all the calls that were made to Modify.
|
// ModifyCalls gets all the calls that were made to Modify.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedSpec.ModifyCalls())
|
// len(mockedSpec.ModifyCalls())
|
||||||
func (mock *SpecMock) ModifyCalls() []struct {
|
func (mock *SpecMock) ModifyCalls() []struct {
|
||||||
SpecModifier SpecModifier
|
SpecModifier SpecModifier
|
||||||
|
@ -67,6 +67,7 @@ func (mock *ConstraintMock) Assert() error {
|
|||||||
|
|
||||||
// AssertCalls gets all the calls that were made to Assert.
|
// AssertCalls gets all the calls that were made to Assert.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedConstraint.AssertCalls())
|
// len(mockedConstraint.AssertCalls())
|
||||||
func (mock *ConstraintMock) AssertCalls() []struct {
|
func (mock *ConstraintMock) AssertCalls() []struct {
|
||||||
} {
|
} {
|
||||||
@ -96,6 +97,7 @@ func (mock *ConstraintMock) String() string {
|
|||||||
|
|
||||||
// StringCalls gets all the calls that were made to String.
|
// StringCalls gets all the calls that were made to String.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedConstraint.StringCalls())
|
// len(mockedConstraint.StringCalls())
|
||||||
func (mock *ConstraintMock) StringCalls() []struct {
|
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.
|
// CompareToCalls gets all the calls that were made to CompareTo.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedProperty.CompareToCalls())
|
// len(mockedProperty.CompareToCalls())
|
||||||
func (mock *PropertyMock) CompareToCalls() []struct {
|
func (mock *PropertyMock) CompareToCalls() []struct {
|
||||||
S string
|
S string
|
||||||
@ -136,6 +137,7 @@ func (mock *PropertyMock) Name() string {
|
|||||||
|
|
||||||
// NameCalls gets all the calls that were made to Name.
|
// NameCalls gets all the calls that were made to Name.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedProperty.NameCalls())
|
// len(mockedProperty.NameCalls())
|
||||||
func (mock *PropertyMock) NameCalls() []struct {
|
func (mock *PropertyMock) NameCalls() []struct {
|
||||||
} {
|
} {
|
||||||
@ -165,6 +167,7 @@ func (mock *PropertyMock) String() string {
|
|||||||
|
|
||||||
// StringCalls gets all the calls that were made to String.
|
// StringCalls gets all the calls that were made to String.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedProperty.StringCalls())
|
// len(mockedProperty.StringCalls())
|
||||||
func (mock *PropertyMock) StringCalls() []struct {
|
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.
|
// ValidateCalls gets all the calls that were made to Validate.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedProperty.ValidateCalls())
|
// len(mockedProperty.ValidateCalls())
|
||||||
func (mock *PropertyMock) ValidateCalls() []struct {
|
func (mock *PropertyMock) ValidateCalls() []struct {
|
||||||
S string
|
S string
|
||||||
@ -229,6 +233,7 @@ func (mock *PropertyMock) Value() (string, error) {
|
|||||||
|
|
||||||
// ValueCalls gets all the calls that were made to Value.
|
// ValueCalls gets all the calls that were made to Value.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
|
//
|
||||||
// len(mockedProperty.ValueCalls())
|
// len(mockedProperty.ValueCalls())
|
||||||
func (mock *PropertyMock) ValueCalls() []struct {
|
func (mock *PropertyMock) ValueCalls() []struct {
|
||||||
} {
|
} {
|
||||||
|
Loading…
Reference in New Issue
Block a user