forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile_mock_test.go
132 lines (107 loc) · 2.72 KB
/
file_mock_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package intel_powerstat
import (
io "io"
mock "github.com/stretchr/testify/mock"
)
// mockFileService is an autogenerated mock type for the fileService type
type mockFileService struct {
mock.Mock
}
// getCPUInfoStats provides a mock function with given fields:
func (_m *mockFileService) getCPUInfoStats() (map[string]*cpuInfo, error) {
ret := _m.Called()
var r0 map[string]*cpuInfo
if rf, ok := ret.Get(0).(func() map[string]*cpuInfo); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]*cpuInfo)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// getStringsMatchingPatternOnPath provides a mock function with given fields: path
func (_m *mockFileService) getStringsMatchingPatternOnPath(path string) ([]string, error) {
ret := _m.Called(path)
var r0 []string
if rf, ok := ret.Get(0).(func(string) []string); ok {
r0 = rf(path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// readFile provides a mock function with given fields: path
func (_m *mockFileService) readFile(path string) ([]byte, error) {
ret := _m.Called(path)
var r0 []byte
if rf, ok := ret.Get(0).(func(string) []byte); ok {
r0 = rf(path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// readFileAtOffsetToUint64 provides a mock function with given fields: reader, offset
func (_m *mockFileService) readFileAtOffsetToUint64(reader io.ReaderAt, offset int64) (uint64, error) {
ret := _m.Called(reader, offset)
var r0 uint64
if rf, ok := ret.Get(0).(func(io.ReaderAt, int64) uint64); ok {
r0 = rf(reader, offset)
} else {
r0 = ret.Get(0).(uint64)
}
var r1 error
if rf, ok := ret.Get(1).(func(io.ReaderAt, int64) error); ok {
r1 = rf(reader, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// readFileToFloat64 provides a mock function with given fields: reader
func (_m *mockFileService) readFileToFloat64(reader io.Reader) (float64, int64, error) {
ret := _m.Called(reader)
var r0 float64
if rf, ok := ret.Get(0).(func(io.Reader) float64); ok {
r0 = rf(reader)
} else {
r0 = ret.Get(0).(float64)
}
var r1 int64
if rf, ok := ret.Get(1).(func(io.Reader) int64); ok {
r1 = rf(reader)
} else {
r1 = ret.Get(1).(int64)
}
var r2 error
if rf, ok := ret.Get(2).(func(io.Reader) error); ok {
r2 = rf(reader)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}