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:
Deluan
2016-03-04 09:09:16 -05:00
parent 87e012f3bf
commit 9a246b5432
12 changed files with 239 additions and 48 deletions
+11 -1
View File
@@ -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)