36 lines
1.2 KiB
Go
36 lines
1.2 KiB
Go
|
|
// Code generated by ndpgen. DO NOT EDIT.
|
||
|
|
//
|
||
|
|
// This file contains mock implementations for non-WASM builds.
|
||
|
|
// These mocks allow IDE support, compilation, and unit testing on non-WASM platforms.
|
||
|
|
// Plugin authors can use the exported mock instances to set expectations in tests.
|
||
|
|
//
|
||
|
|
//go:build !wasip1
|
||
|
|
|
||
|
|
package host
|
||
|
|
|
||
|
|
import "github.com/stretchr/testify/mock"
|
||
|
|
|
||
|
|
// mockSubsonicAPIService is the mock implementation for testing.
|
||
|
|
type mockSubsonicAPIService struct {
|
||
|
|
mock.Mock
|
||
|
|
}
|
||
|
|
|
||
|
|
// SubsonicAPIMock is the auto-instantiated mock instance for testing.
|
||
|
|
// Use this to set expectations: host.SubsonicAPIMock.On("MethodName", args...).Return(values...)
|
||
|
|
var SubsonicAPIMock = &mockSubsonicAPIService{}
|
||
|
|
|
||
|
|
// Call is the mock method for SubsonicAPICall.
|
||
|
|
func (m *mockSubsonicAPIService) Call(uri string) (string, error) {
|
||
|
|
args := m.Called(uri)
|
||
|
|
return args.String(0), args.Error(1)
|
||
|
|
}
|
||
|
|
|
||
|
|
// SubsonicAPICall delegates to the mock instance.
|
||
|
|
// Call executes a Subsonic API request and returns the JSON response.
|
||
|
|
//
|
||
|
|
// The uri parameter should be the Subsonic API path without the server prefix,
|
||
|
|
// e.g., "getAlbumList2?type=random&size=10". The response is returned as raw JSON.
|
||
|
|
func SubsonicAPICall(uri string) (string, error) {
|
||
|
|
return SubsonicAPIMock.Call(uri)
|
||
|
|
}
|