getCoverArt.view working

This commit is contained in:
Deluan
2016-03-03 12:08:44 -05:00
parent 1b945831cc
commit c9455e1955
9 changed files with 148 additions and 2 deletions
+6
View File
@@ -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)