First version of getAlbumList.view working.
- It still misses almost all type options - Introduced "parent" in Child subresponse, as it was breaking DSub
This commit is contained in:
+11
-1
@@ -2,12 +2,12 @@ package tests
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"github.com/deluan/gosonic/api/responses"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"crypto/md5"
|
||||
)
|
||||
|
||||
func ShouldMatchXML(actual interface{}, expected ...interface{}) string {
|
||||
@@ -49,6 +49,16 @@ func ShouldMatchMD5(actual interface{}, expected ...interface{}) string {
|
||||
return ShouldEqual(a, expected[0].(string))
|
||||
}
|
||||
|
||||
func ShouldBeAValid(actual interface{}, expected ...interface{}) string {
|
||||
v := responses.Subsonic{}
|
||||
err := json.Unmarshal(actual.(*bytes.Buffer).Bytes(), &v)
|
||||
if err != nil {
|
||||
return fmt.Sprintf("Malformed response: %v", err)
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func UnindentJSON(j []byte) string {
|
||||
var m = make(map[string]interface{})
|
||||
json.Unmarshal(j, &m)
|
||||
|
||||
Reference in New Issue
Block a user