github.com/rohankumardubey/aresdb@v0.0.2-0.20190517170215-e54e3ca06b9c/utils/mocks/file_system.go (about) 1 // Copyright (c) 2017-2018 Uber Technologies, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Package mocks generated by mockery v1.0.0 16 package mocks 17 18 import io "io" 19 20 import mock "github.com/stretchr/testify/mock" 21 import os "os" 22 23 // FileSystem is an autogenerated mock type for the FileSystem type 24 type FileSystem struct { 25 mock.Mock 26 } 27 28 // Mkdir provides a mock function with given fields: name, perm 29 func (_m *FileSystem) Mkdir(name string, perm os.FileMode) error { 30 ret := _m.Called(name, perm) 31 32 var r0 error 33 if rf, ok := ret.Get(0).(func(string, os.FileMode) error); ok { 34 r0 = rf(name, perm) 35 } else { 36 r0 = ret.Error(0) 37 } 38 39 return r0 40 } 41 42 // MkdirAll provides a mock function with given fields: path, perm 43 func (_m *FileSystem) MkdirAll(path string, perm os.FileMode) error { 44 ret := _m.Called(path, perm) 45 46 var r0 error 47 if rf, ok := ret.Get(0).(func(string, os.FileMode) error); ok { 48 r0 = rf(path, perm) 49 } else { 50 r0 = ret.Error(0) 51 } 52 53 return r0 54 } 55 56 // OpenFileForWrite provides a mock function with given fields: name, flag, perm 57 func (_m *FileSystem) OpenFileForWrite(name string, flag int, perm os.FileMode) (io.WriteCloser, error) { 58 ret := _m.Called(name, flag, perm) 59 60 var r0 io.WriteCloser 61 if rf, ok := ret.Get(0).(func(string, int, os.FileMode) io.WriteCloser); ok { 62 r0 = rf(name, flag, perm) 63 } else { 64 if ret.Get(0) != nil { 65 r0 = ret.Get(0).(io.WriteCloser) 66 } 67 } 68 69 var r1 error 70 if rf, ok := ret.Get(1).(func(string, int, os.FileMode) error); ok { 71 r1 = rf(name, flag, perm) 72 } else { 73 r1 = ret.Error(1) 74 } 75 76 return r0, r1 77 } 78 79 // ReadDir provides a mock function with given fields: dirname 80 func (_m *FileSystem) ReadDir(dirname string) ([]os.FileInfo, error) { 81 ret := _m.Called(dirname) 82 83 var r0 []os.FileInfo 84 if rf, ok := ret.Get(0).(func(string) []os.FileInfo); ok { 85 r0 = rf(dirname) 86 } else { 87 if ret.Get(0) != nil { 88 r0 = ret.Get(0).([]os.FileInfo) 89 } 90 } 91 92 var r1 error 93 if rf, ok := ret.Get(1).(func(string) error); ok { 94 r1 = rf(dirname) 95 } else { 96 r1 = ret.Error(1) 97 } 98 99 return r0, r1 100 } 101 102 // ReadFile provides a mock function with given fields: filename 103 func (_m *FileSystem) ReadFile(filename string) ([]byte, error) { 104 ret := _m.Called(filename) 105 106 var r0 []byte 107 if rf, ok := ret.Get(0).(func(string) []byte); ok { 108 r0 = rf(filename) 109 } else { 110 if ret.Get(0) != nil { 111 r0 = ret.Get(0).([]byte) 112 } 113 } 114 115 var r1 error 116 if rf, ok := ret.Get(1).(func(string) error); ok { 117 r1 = rf(filename) 118 } else { 119 r1 = ret.Error(1) 120 } 121 122 return r0, r1 123 } 124 125 // Remove provides a mock function with given fields: path 126 func (_m *FileSystem) Remove(path string) error { 127 ret := _m.Called(path) 128 129 var r0 error 130 if rf, ok := ret.Get(0).(func(string) error); ok { 131 r0 = rf(path) 132 } else { 133 r0 = ret.Error(0) 134 } 135 136 return r0 137 } 138 139 // RemoveAll provides a mock function with given fields: path 140 func (_m *FileSystem) RemoveAll(path string) error { 141 ret := _m.Called(path) 142 143 var r0 error 144 if rf, ok := ret.Get(0).(func(string) error); ok { 145 r0 = rf(path) 146 } else { 147 r0 = ret.Error(0) 148 } 149 150 return r0 151 } 152 153 // Stat provides a mock function with given fields: path 154 func (_m *FileSystem) Stat(path string) (os.FileInfo, error) { 155 ret := _m.Called(path) 156 157 var r0 os.FileInfo 158 if rf, ok := ret.Get(0).(func(string) os.FileInfo); ok { 159 r0 = rf(path) 160 } else { 161 if ret.Get(0) != nil { 162 r0 = ret.Get(0).(os.FileInfo) 163 } 164 } 165 166 var r1 error 167 if rf, ok := ret.Get(1).(func(string) error); ok { 168 r1 = rf(path) 169 } else { 170 r1 = ret.Error(1) 171 } 172 173 return r0, r1 174 }