Add context to all methods in engine layer

This commit is contained in:
Deluan
2020-01-22 08:32:31 -05:00
parent c73f549c83
commit f0ee41a8af
14 changed files with 44 additions and 37 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
package engine
import (
"context"
"errors"
"github.com/cloudsonic/sonic-server/model"
@@ -24,7 +25,7 @@ var _ = Describe("Browser", func() {
})
It("returns sorted data", func() {
Expect(b.GetGenres()).To(Equal(model.Genres{
Expect(b.GetGenres(context.TODO())).To(Equal(model.Genres{
{Name: "<Empty>", SongCount: 13, AlbumCount: 13},
{Name: "Electronic", SongCount: 4000, AlbumCount: 40},
{Name: "Rock", SongCount: 1000, AlbumCount: 100},
@@ -33,7 +34,7 @@ var _ = Describe("Browser", func() {
It("bubbles up errors", func() {
repo.err = errors.New("generic error")
_, err := b.GetGenres()
_, err := b.GetGenres(context.TODO())
Expect(err).ToNot(BeNil())
})
})