mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
56c2ab3d58
Make it possible to advertise also other than simple 'true' values for feature labels.
49 lines
946 B
Go
49 lines
946 B
Go
package main
|
|
|
|
import (
|
|
"github.com/kubernetes-incubator/node-feature-discovery/source"
|
|
"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() (source.Features, error) {
|
|
ret := _m.Called()
|
|
|
|
var r0 source.Features
|
|
if rf, ok := ret.Get(0).(func() source.Features); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(source.Features)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|