feat(loopback): add ability to mock putObject response
This commit is contained in:
1 parent
e1540be9f3
commit
331254402a
3 files changed
+60
-9
No files matched your search
@@ -52,9 +52,10 @@ func NewLoopbackPlugin(opt ...TestOption) (*LoopbackPlugin, error) {
|
||||
hostMap: make(map[string][]*loopbackPluginHostInfo),
|
||||
},
|
||||
LoopbackStorage: &LoopbackStorage{
|
||||
chunksSize: opts.withChunkSize,
|
||||
buckets: map[BucketName]Bucket{"default": {}},
|
||||
errs: make([]PluginMockError, 0),
|
||||
chunksSize: opts.withChunkSize,
|
||||
buckets: map[BucketName]Bucket{"default": {}},
|
||||
errs: make([]PluginMockError, 0),
|
||||
putObjectResponse: make([]PluginMockPutObjectResponse, 0),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -80,6 +81,9 @@ func NewLoopbackPlugin(opt ...TestOption) (*LoopbackPlugin, error) {
|
||||
if len(opts.withMockError) > 0 {
|
||||
ret.errs = opts.withMockError
|
||||
}
|
||||
if len(opts.withMockPutObjectResponse) > 0 {
|
||||
ret.putObjectResponse = opts.withMockPutObjectResponse
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
Reference in new issue
Block a user