getCoverArt.view working
This commit is contained in:
Binary file not shown.
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/deluan/gosonic/api/responses"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"crypto/md5"
|
||||
)
|
||||
|
||||
func ShouldMatchXML(actual interface{}, expected ...interface{}) string {
|
||||
@@ -43,6 +44,11 @@ func ShouldReceiveError(actual interface{}, expected ...interface{}) string {
|
||||
return ShouldEqual(v.Error.Code, expected[0].(int))
|
||||
}
|
||||
|
||||
func ShouldMatchMD5(actual interface{}, expected ...interface{}) string {
|
||||
a := fmt.Sprintf("%x", md5.Sum(actual.([]byte)))
|
||||
return ShouldEqual(a, expected[0].(string))
|
||||
}
|
||||
|
||||
func UnindentJSON(j []byte) string {
|
||||
var m = make(map[string]interface{})
|
||||
json.Unmarshal(j, &m)
|
||||
|
||||
@@ -45,7 +45,11 @@ func (m *MockMediaFile) Get(id string) (*domain.MediaFile, error) {
|
||||
if m.err {
|
||||
return nil, errors.New("Error!")
|
||||
}
|
||||
return m.data[id], nil
|
||||
mf := m.data[id]
|
||||
if mf == nil {
|
||||
mf = &domain.MediaFile{}
|
||||
}
|
||||
return mf, nil
|
||||
}
|
||||
|
||||
func (m *MockMediaFile) FindByAlbum(artistId string) ([]domain.MediaFile, error) {
|
||||
|
||||
Reference in New Issue
Block a user