mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
d5a9c621f9
- Updated mock tests. - Refactored to get more coverage. - Minor changes to normalize error reporting.
46 lines
848 B
Go
46 lines
848 B
Go
package main
|
|
|
|
import "github.com/stretchr/testify/mock"
|
|
|
|
type MockFeatureSource struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Name provides a mock function with no input arguments
|
|
// and string as return value
|
|
func (_m *MockFeatureSource) Name() string {
|
|
ret := _m.Called()
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Discover provides a mock function with no input arguments
|
|
// and []string and error as the return values
|
|
func (_m *MockFeatureSource) Discover() ([]string, error) {
|
|
ret := _m.Called()
|
|
|
|
var r0 []string
|
|
if rf, ok := ret.Get(0).(func() []string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|