mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Refactored agents calling into its own struct
This commit is contained in:
parent
6c1ba8f0d0
commit
f9eec5e4dc
5 changed files with 516 additions and 190 deletions
23
utils/context_test.go
Normal file
23
utils/context_test.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package utils_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/navidrome/navidrome/utils"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = Describe("IsCtxDone", func() {
|
||||
It("returns false if the context is not done", func() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
Expect(utils.IsCtxDone(ctx)).To(BeFalse())
|
||||
})
|
||||
|
||||
It("returns true if the context is done", func() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
Expect(utils.IsCtxDone(ctx)).To(BeTrue())
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue