Skip to content

Commit

Permalink
test: fix capability tests (livepeer#3107)
Browse files Browse the repository at this point in the history
This commit ensures that the stubOS struct is in-line with the latest
[livepeer/go-tools](https://github.com/livepeer/go-tools/) version.
  • Loading branch information
rickstaa authored and reubenr0d committed Oct 2, 2024
1 parent 4258462 commit 1dde003
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions core/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,26 +382,35 @@ type stubOS struct {
storageType int32
}

func (os *stubOS) OS() drivers.OSDriver {
return nil
}
func (os *stubOS) SaveData(context.Context, string, io.Reader, *drivers.FileProperties, time.Duration) (string, error) {
return "", nil
}
func (os *stubOS) EndSession() {}
func (os *stubOS) GetInfo() *drivers.OSInfo {
if os.storageType == stubOSMagic {
return nil
}
return &drivers.OSInfo{StorageType: drivers.OSInfo_StorageType(os.storageType)}
}
func (os *stubOS) EndSession() {}
func (os *stubOS) SaveData(context.Context, string, io.Reader, map[string]string, time.Duration) (string, error) {
return "", nil
}
func (os *stubOS) IsExternal() bool { return false }
func (os *stubOS) IsOwn(url string) bool { return true }
func (os *stubOS) ListFiles(ctx context.Context, prefix, delim string) (drivers.PageInfo, error) {
return nil, nil
}
func (os *stubOS) DeleteFile(ctx context.Context, name string) error {
return nil
}
func (os *stubOS) ReadData(ctx context.Context, name string) (*drivers.FileInfoReader, error) {
return nil, nil
}
func (os *stubOS) OS() drivers.OSDriver {
return nil
func (os *stubOS) ReadDataRange(ctx context.Context, name, byteRange string) (*drivers.FileInfoReader, error) {
return nil, nil
}
func (os *stubOS) Presign(name string, expire time.Duration) (string, error) {
return "", nil
}

func TestCapability_StorageToCapability(t *testing.T) {
Expand Down

0 comments on commit 1dde003

Please sign in to comment.