mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-06 04:58:33 +02:00
Make web service clients context aware
This commit is contained in:
parent
adfe3f5771
commit
d1642b7f1f
15 changed files with 128 additions and 76 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>
|
||||
Copyright © 2023-2025 Philipp Wolfer <phw@uploadedlobster.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -22,6 +22,7 @@ THE SOFTWARE.
|
|||
package funkwhale_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
|
@ -49,7 +50,8 @@ func TestGetHistoryListenings(t *testing.T) {
|
|||
"https://funkwhale.example.com/api/v1/history/listenings",
|
||||
"testdata/listenings.json")
|
||||
|
||||
result, err := client.GetHistoryListenings("outsidecontext", 0, 2)
|
||||
ctx := context.Background()
|
||||
result, err := client.GetHistoryListenings(ctx, "outsidecontext", 0, 2)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert := assert.New(t)
|
||||
|
@ -73,7 +75,8 @@ func TestGetFavoriteTracks(t *testing.T) {
|
|||
"https://funkwhale.example.com/api/v1/favorites/tracks",
|
||||
"testdata/favorite-tracks.json")
|
||||
|
||||
result, err := client.GetFavoriteTracks(0, 2)
|
||||
ctx := context.Background()
|
||||
result, err := client.GetFavoriteTracks(ctx, 0, 2)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert := assert.New(t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue