1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/mockfeaturesource.go
Balaji Subramaniam d5a9c621f9 Added tests.
- Updated mock tests.
- Refactored to get more coverage.
- Minor changes to normalize error reporting.
2016-08-30 14:42:59 -07:00

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
}